From: Anthony Liguori <anthony@codemonkey.ws>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] pc: madvise(MADV_DONTNEED) memory on reset
Date: Wed, 24 Feb 2010 16:05:59 -0600 [thread overview]
Message-ID: <4B85A2C7.6040406@codemonkey.ws> (raw)
In-Reply-To: <f43fc5581002241259s61ad8b2ajb1b34519dd944258@mail.gmail.com>
On 02/24/2010 02:59 PM, Blue Swirl wrote:
> On 2/24/10, Anthony Liguori<aliguori@us.ibm.com> wrote:
>
>> If you compare the RSS of a freshly booted guest and the same guest after a
>> reboot, it's very likely the freshly booted guest will have an RSS that is
>> much lower the the rebooted guest because the previous run of the guest faulted
>> in all available memory.
>>
>> This patch addresses this issue by using madvise() during reset. It only
>> resets RAM areas which means it has to be done in the machine. I've only done
>> this for the x86 target because I'm fairly confident that this is allowed
>> architecturally on x86 although I'm not sure this is universely true.
>>
>> This does not appear to have an observable cost with a large memory guest and
>> I can't really think of any down sides.
>>
> I think it would be much cleaner to make the madvise() calls from
> exec.c, now you are duplicating some of the functionality there. The
> calls could be controlled by a global variable (set only in pc.c) so
> non-PC architectures would not be disturbed.
>
One thing we could do (that I think has other uses) is to add a context
parameter to qemu_ram_alloc(). We could start with a simple flag of
something like QRAM_RAM and QRAM_ROM. QRAM_RAM would get automatically
madvise()'d on reset.
But that said, does anyone know of an architecture where this type of
reset would be a problem? Would it be a problem on sparc?
Regards,
Anthony Liguori
next prev parent reply other threads:[~2010-02-24 22:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-24 19:10 [Qemu-devel] [PATCH] pc: madvise(MADV_DONTNEED) memory on reset Anthony Liguori
2010-02-24 20:59 ` Blue Swirl
2010-02-24 22:05 ` Anthony Liguori [this message]
2010-02-28 0:57 ` Paul Brook
2010-02-24 23:56 ` Samuel Thibault
2010-02-28 9:13 ` Stefan Hajnoczi
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=4B85A2C7.6040406@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.