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: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] pc: madvise(MADV_DONTNEED) memory on reset
Date: Sun, 28 Feb 2010 09:13:34 +0000

On Wed, Feb 24, 2010 at 7:10 PM, Anthony Liguori <address@hidden> wrote:
> 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.

Preserving the contents of memory across reboot seems to be common on
real x86 hardware.  (Even if you hard power off and on again quickly.)

This behavior is useful for crash analysis.  I use it as a tool for
debugging gPXE both on real hardware and under QEMU for example:

http://git.etherboot.org/?p=people/stefanha/gpxe.git;a=commitdiff;h=67344d8c3adca51658e1b8a80541a16e9f693a8d

posix_madvise() is fine but Linux MADV_DONTNEED will prevent this sort
of tool from working.

Would it be possible to make this configurable in some way?  I can
imagine doing something like:
qemu> system_reset -preserve

Stefan




reply via email to

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