[Top][All Lists]
[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
- [Qemu-devel] [PATCH v5 00/11] virtio: virtio-blk data plane, Stefan Hajnoczi, 2012/12/05
- [Qemu-devel] [PATCH v5 01/11] raw-posix: add raw_get_aio_fd() for virtio-blk-data-plane, Stefan Hajnoczi, 2012/12/05
- [Qemu-devel] [PATCH v5 02/11] configure: add CONFIG_VIRTIO_BLK_DATA_PLANE, Stefan Hajnoczi, 2012/12/05
- [Qemu-devel] [PATCH v5 03/11] dataplane: add host memory mapping code, Stefan Hajnoczi, 2012/12/05
- [Qemu-devel] [PATCH v5 04/11] dataplane: add virtqueue vring code, Stefan Hajnoczi, 2012/12/05
- [Qemu-devel] [PATCH v5 05/11] dataplane: add event loop, Stefan Hajnoczi, 2012/12/05
- [Qemu-devel] [PATCH v5 06/11] dataplane: add Linux AIO request queue, Stefan Hajnoczi, 2012/12/05
- [Qemu-devel] [PATCH v5 07/11] iov: add iov_discard() to remove data, Stefan Hajnoczi, 2012/12/05