[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 16/16] virtio: make it possible to detach host notifier fr
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 16/16] virtio: make it possible to detach host notifier from any thread |
Date: |
Wed, 19 Apr 2023 13:51:48 -0500 |
User-agent: |
NeoMutt/20230407 |
On Wed, Apr 19, 2023 at 01:28:17PM -0400, Stefan Hajnoczi wrote:
> virtio_queue_aio_detach_host_notifier() does two things:
> 1. It removes the fd handler from the event loop.
> 2. It processes the virtqueue one last time.
>
> The first step can be peformed by any thread and without taking the
> AioContext lock.
>
> The second step may need the AioContext lock (depending on the device
> implementation) and runs in the thread where request processing takes
> place. virtio-blk and virtio-scsi therefore call
> virtio_queue_aio_detach_host_notifier() from a BH that is scheduled in
> AioContext
>
> Scheduling a BH is undesirable for .drained_begin() functions. The next
> patch will introduce a .drained_begin() function that needs to call
> virtio_queue_aio_detach_host_notifier().
>
> Move the virtqueue processing out to the callers of
> virtio_queue_aio_detach_host_notifier() so that the function can be
> called from any thread. This is in preparation for the next patch.
>
This mentions a next patch, but is 16/16 in the series. Am I missing
something?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- Re: [PATCH v2 08/16] hw/xen: do not use aio_set_fd_handler(is_external=true) in xen_xenstore, (continued)
- [PATCH v2 07/16] block/export: stop using is_external in vhost-user-blk server, Stefan Hajnoczi, 2023/04/19
- [PATCH v2 09/16] block: add blk_in_drain() API, Stefan Hajnoczi, 2023/04/19
- [PATCH v2 10/16] block: drain from main loop thread in bdrv_co_yield_to_drain(), Stefan Hajnoczi, 2023/04/19
- [PATCH v2 11/16] xen-block: implement BlockDevOps->drained_begin(), Stefan Hajnoczi, 2023/04/19
- [PATCH v2 12/16] hw/xen: do not set is_external=true on evtchn fds, Stefan Hajnoczi, 2023/04/19
- [PATCH v2 13/16] block/export: rewrite vduse-blk drain code, Stefan Hajnoczi, 2023/04/19
- [PATCH v2 14/16] block/export: don't require AioContext lock around blk_exp_ref/unref(), Stefan Hajnoczi, 2023/04/19
- [PATCH v2 15/16] block/fuse: do not set is_external=true on FUSE fd, Stefan Hajnoczi, 2023/04/19
- [PATCH v2 16/16] virtio: make it possible to detach host notifier from any thread, Stefan Hajnoczi, 2023/04/19
- Re: [PATCH v2 16/16] virtio: make it possible to detach host notifier from any thread,
Eric Blake <=