qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 03/11] dataplane: add host memory mapping cod


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v5 03/11] dataplane: add host memory mapping code
Date: Sun, 9 Dec 2012 11:36:01 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Dec 09, 2012 at 12:02:52PM +0800, liu ping fan wrote:
> On Thu, Dec 6, 2012 at 4:47 AM, Stefan Hajnoczi <address@hidden> wrote:
> > +void hostmem_init(Hostmem *hostmem)
> > +{
> > +    memset(hostmem, 0, sizeof(*hostmem));
> > +
> > +    hostmem->listener = (MemoryListener){
> > +        .begin = hostmem_listener_dummy,
> > +        .commit = hostmem_listener_commit,
> 
> I think, here, if we sync on big lock, and flush out dangling pointer
> in data-plane thread, then we can survive from the unplug.

Hot unplug support requires that the data plane thread completes all
requests and doesn't process any new requests until the critical region
completes (e.g. hot memory unplug).

vm_stop() + bdrv_drain_all() achieves this:
1. vcpus are stopped so no new requests can be submitted by the guest.
2. bdrv_drain_all() completes all Linux AIO requests so we're no longer
   accessing guest memory.

vcpus should be enabled again after hot unplug.

> > +        .region_add = hostmem_listener_append_region,
> > +        .region_del = hostmem_listener_section_dummy,
> 
> And here we should remove the corresponding info in hostmem

.region_del() is not necessary because we rebuild a fresh memory region
list.  We never update the memory region list once it has been
installed.

This means the .region_add() and .region_nop() information is enough to
build a fresh list from scratch.

Stefan



reply via email to

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