From: Eduardo Habkost <ehabkost@redhat.com>
To: Michal Privoznik <mprivozn@redhat.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Zack Cornelius <zack.cornelius@kove.net>
Subject: Re: [Qemu-devel] Purpose of memory-backend-file.discard-data
Date: Mon, 16 Apr 2018 14:59:55 -0300 [thread overview]
Message-ID: <20180416175955.GO29865@localhost.localdomain> (raw)
In-Reply-To: <0c14166c-28c4-a1ad-093b-ba63e373e790@redhat.com>
(CCing Zack Cornelius)
On Fri, Apr 13, 2018 at 08:21:26AM +0200, Michal Privoznik wrote:
> Eduardo et al,
>
> I'm looking at 11ae6ed8affdd131e and I wanted to implement libvirt
> support for that. But more I look at it less I understand it. My
> understanding it is an optimization (although not very effective one
> since madvise() is/should be immediately followed by munmap()). So any
> application that is trying to keep track of guest memory can stop doing
> so as soon as it sees munmap(). Or does the optimization lies in fact
> that madvise() is called sooner and thus the app can stop caring
> slightly sooner?
munmap() or close() are not enough: it would still make the host
kernel unnecessarily write data to backing storage. The point of
the madvise() call is to tell the kernel that data can be
destroyed instead of being written back.
The original use case is described by Zack here:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg473538.html
>
> Also, I don't quite understand why is this configurable. What's the harm
> in turning it on by default? Yesterday I've posted some patches to
> libvirt list [1] (although I have to admit I am still not fully
> convinced about the design) and they implement just this - whenever qemu
> supports the feature libvirt turns it on.S
The option can destroy the data on the backing file, so QEMU can't enable it by
default. libvirt can enable it as long as it knows it can destroy the data on
the backing file.
>
> Michal
>
> 1: https://www.redhat.com/archives/libvir-list/2018-April/msg01066.html
--
Eduardo
next prev parent reply other threads:[~2018-04-16 18:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 6:21 [Qemu-devel] Purpose of memory-backend-file.discard-data Michal Privoznik
2018-04-16 17:59 ` Eduardo Habkost [this message]
2018-04-17 8:23 ` Michal Privoznik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180416175955.GO29865@localhost.localdomain \
--to=ehabkost@redhat.com \
--cc=mprivozn@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zack.cornelius@kove.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).