qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] pc: madvise(MADV_DONTNEED) memory on reset


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] pc: madvise(MADV_DONTNEED) memory on reset
Date: Wed, 24 Feb 2010 16:05:59 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 02/24/2010 02:59 PM, Blue Swirl wrote:
On 2/24/10, Anthony Liguori<address@hidden>  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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]