qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Re: [PATCH] add MADV_DONTFORK to guest physical memory


From: Gleb Natapov
Subject: Re: [Qemu-devel] Re: [PATCH] add MADV_DONTFORK to guest physical memory
Date: Thu, 16 Sep 2010 08:51:15 +0200

On Wed, Sep 15, 2010 at 11:03:14PM +0200, Michael S. Tsirkin wrote:
> On Wed, Sep 15, 2010 at 07:08:24PM +0200, Andrea Arcangeli wrote:
> > From: Andrea Arcangeli <address@hidden>
> > 
> > All allocated guest physical memory shall be marked MADV_DONTFORK, otherwise
> > fork will fail because of accounting issues preventing migration or 
> > netdev_add
> > when the guest allocated more than half of host physical memory.
> > 
> > Signed-off-by: Andrea Arcangeli <address@hidden>
> > ---
> > 
> > diff --git a/exec.c b/exec.c
> > index 380dab5..e2bdf19 100644
> > --- a/exec.c
> > +++ b/exec.c
> > @@ -2861,6 +2861,9 @@ ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, 
> > const char *name,
> >  #ifdef MADV_MERGEABLE
> >              madvise(new_block->host, size, MADV_MERGEABLE);
> >  #endif
> > +#ifdef MADV_DONTFORK
> > +            madvise(new_block->host, size, MADV_DONTFORK);
> > +#endif
> >          }
> >      }
> 
> Is this always a number of full host pages? If not, we'd get trouble
> when trying to call helpers.
> 
How it can be not a number of full host pages? This is guest memory.

--
                        Gleb.



reply via email to

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