qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>,
	qemu-devel@nongnu.org, Gleb Natapov <gleb@redhat.com>,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] PING^2 Re: [PATCH] KVM: always use MADV_DONTFORK
Date: Fri, 30 Aug 2013 17:52:10 +0200	[thread overview]
Message-ID: <5220BFAA.4090300@suse.de> (raw)
In-Reply-To: <5220BEC1.5040908@redhat.com>

Am 30.08.2013 17:48, schrieb Paolo Bonzini:
> Il 06/08/2013 18:47, Paolo Bonzini ha scritto:
>> On 07/25/2013 12:11 PM, Andrea Arcangeli wrote:
>>> MADV_DONTFORK prevents fork to fail with -ENOMEM if the default
>>> overcommit heuristics decides there's too much anonymous virtual
>>> memory allocated. If the KVM secondary MMU is synchronized with MMU
>>> notifiers or not, doesn't make a difference in that regard.
>>>
>>> Secondly it's always more efficient to avoid copying the guest
>>> physical address space in the fork child (so we avoid to mark all the
>>> guest memory readonly in the parent and so we skip the establishment
>>> and teardown of lots of pagetables in the child).
>>>
>>> In the common case we can ignore the error if MADV_DONTFORK is not
>>> available. Leave a second invocation that errors out in the KVM path
>>> if MMU notifiers are missing and KVM is enabled, to abort in such
>>> case.
>>>
>>> Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
>>> ---
>>>   exec.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/exec.c b/exec.c
>>> index c99a883..d3bb58d 100644
>>> --- a/exec.c
>>> +++ b/exec.c
>>> @@ -1162,6 +1162,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t
>>> size, void *host,
>>>
>>>       qemu_ram_setup_dump(new_block->host, size);
>>>       qemu_madvise(new_block->host, size, QEMU_MADV_HUGEPAGE);
>>> +    qemu_madvise(new_block->host, size, QEMU_MADV_DONTFORK);
>>>
>>>       if (kvm_enabled())
>>>           kvm_setup_guest_memory(new_block->host, size);
>>>
>>>
>>
>> PING.
>>
>> Benoit reported this on IRC, too.
>>
>> Paolo
>>
>>
> 
> PING^2
> 
> The last paragraph of the commit message should answer Andreas's objection.

OK. The patch is mislabelled as "KVM:" though putting this in a common
code path and touching exec.c only, so please put it on uq/master and
fix that up before you set the history in stone. :)

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg

  reply	other threads:[~2013-08-30 15:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-25 10:11 [Qemu-devel] [PATCH] KVM: always use MADV_DONTFORK Andrea Arcangeli
2013-07-25 10:16 ` Peter Maydell
2013-07-25 10:32   ` Andrea Arcangeli
2013-08-06 16:55     ` Andreas Färber
2013-08-30 15:48       ` Paolo Bonzini
2013-08-06 16:47 ` [Qemu-devel] PING for-1.6 " Paolo Bonzini
2013-08-30 15:48   ` [Qemu-devel] PING^2 " Paolo Bonzini
2013-08-30 15:52     ` Andreas Färber [this message]
2013-08-30 16:03       ` Paolo Bonzini
2013-08-30 16:21         ` Gleb Natapov
2013-08-30 16:40           ` Paolo Bonzini
2013-08-06 17:06 ` [Qemu-devel] " Benoît Canet
2013-09-01  9:39 ` Gleb Natapov

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=5220BFAA.4090300@suse.de \
    --to=afaerber@suse.de \
    --cc=aarcange@redhat.com \
    --cc=gleb@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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 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).