On Fri, May 11, 2018 at 05:09:18PM +0200, Michal Privoznik wrote:
https://bugzilla.redhat.com/show_bug.cgi?id=1480668
QEMU has this new feature memory-backend-file.discard-data=yes
which is a nifty optimization. Basically, when qemu is quitting
or on memory hotplug it calls munmap() and close() on the file
that is backing the memory. However, this does not mean kernel
won't stop touching that part of memory. It still might. With
this feature enabled we tell kernel: "we don't need this memory
nor data stored in it". This makes kernel drop the memory
immediately without trying to sync memory with the mapped file.
Unfortunately, this cannot be turned on by default because we
can't be sure when users really don't care about what happens to
data after qemu dies. So it has to be opt-in. As usual, there are
three places where one can configure memory attributes. This
patch adds the feature to all of them.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_command.c | 27 ++++++++++++++++++++++++---
tests/qemuxml2argvdata/hugepages-pages.args | 12 ++++++------
tests/qemuxml2argvdata/hugepages-pages3.args | 3 ++-
tests/qemuxml2argvdata/hugepages-pages7.args | 3 ++-
tests/qemuxml2argvtest.c | 9 ++++++---
5 files changed, 40 insertions(+), 14 deletions(-)
Reviewed-by: Ján Tomko <jtomko(a)redhat.com>
Jano