[libvirt] [PATCH v5 7/7] qemu: Implement memoryBacking/discard

Ján Tomko jtomko at redhat.com
Fri May 11 16:15:02 UTC 2018


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 at 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 at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180511/b8d32902/attachment-0001.sig>


More information about the libvir-list mailing list