qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] nbd/server: Quiesce coroutines on context switch
@ 2020-12-14 17:05 Sergio Lopez
  2020-12-14 17:05 ` [PATCH v2 1/4] block: Honor blk_set_aio_context() context requirements Sergio Lopez
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Sergio Lopez @ 2020-12-14 17:05 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, Fam Zheng, Stefano Stabellini, Sergio Lopez,
	qemu-block, Paul Durrant, Michael S. Tsirkin, Max Reitz,
	Stefan Hajnoczi, Paolo Bonzini, Anthony Perard, xen-devel

This series allows the NBD server to properly switch between AIO contexts,
having quiesced recv_coroutine and send_coroutine before doing the transition.

We need this because we send back devices running in IO Thread owned contexts
to the main context when stopping the data plane, something that can happen
multiple times during the lifetime of a VM (usually during the boot sequence or
on a reboot), and we drag the NBD server of the correspoing export with it.

While there, fix also a problem caused by a cross-dependency between
closing the export's client connections and draining the block
layer. The visible effect of this problem was QEMU getting hung when
the guest request a power off while there's an active NBD client.

v2:
 - Replace "virtio-blk: Acquire context while switching them on
 dataplane start" with "block: Honor blk_set_aio_context() context
 requirements" (Kevin Wolf)
 - Add "block: Avoid processing BDS twice in
 bdrv_set_aio_context_ignore()"
 - Add "block: Close block exports in two steps"
 - Rename nbd_read_eof() to nbd_server_read_eof() (Eric Blake)
 - Fix double space and typo in comment. (Eric Blake)

Sergio Lopez (4):
  block: Honor blk_set_aio_context() context requirements
  block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()
  nbd/server: Quiesce coroutines on context switch
  block: Close block exports in two steps

 block.c                         |  27 ++++++-
 block/export/export.c           |  10 +--
 blockdev-nbd.c                  |   2 +-
 hw/block/dataplane/virtio-blk.c |   4 ++
 hw/block/dataplane/xen-block.c  |   7 +-
 hw/scsi/virtio-scsi.c           |   6 +-
 include/block/export.h          |   4 +-
 nbd/server.c                    | 120 ++++++++++++++++++++++++++++----
 qemu-nbd.c                      |   2 +-
 stubs/blk-exp-close-all.c       |   2 +-
 10 files changed, 156 insertions(+), 28 deletions(-)

-- 
2.26.2




^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2021-01-21  5:59 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 17:05 [PATCH v2 0/4] nbd/server: Quiesce coroutines on context switch Sergio Lopez
2020-12-14 17:05 ` [PATCH v2 1/4] block: Honor blk_set_aio_context() context requirements Sergio Lopez
2020-12-15 11:58   ` Kevin Wolf
2020-12-14 17:05 ` [PATCH v2 2/4] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore() Sergio Lopez
2020-12-15 12:12   ` Kevin Wolf
2020-12-15 13:15     ` Sergio Lopez
2020-12-15 15:01       ` Kevin Wolf
2020-12-15 17:23         ` Sergio Lopez
2020-12-16 12:35           ` Kevin Wolf
2020-12-16 14:55             ` Sergio Lopez
2020-12-16 18:31               ` Kevin Wolf
2020-12-17  9:37                 ` Sergio Lopez
2020-12-17 10:58                   ` Kevin Wolf
2020-12-17 12:50                     ` Vladimir Sementsov-Ogievskiy
2020-12-17 13:06                       ` Kevin Wolf
2020-12-17 13:27                         ` Sergio Lopez
2020-12-17 14:01                         ` Vladimir Sementsov-Ogievskiy
2020-12-17 13:09                     ` Sergio Lopez
2020-12-14 17:05 ` [PATCH v2 3/4] nbd/server: Quiesce coroutines on context switch Sergio Lopez
2020-12-14 17:05 ` [PATCH v2 4/4] block: Close block exports in two steps Sergio Lopez
2020-12-15 15:34   ` Kevin Wolf
2020-12-15 17:26     ` Sergio Lopez
2020-12-21 17:07     ` Sergio Lopez
2021-01-20 20:49 ` [PATCH v2 0/4] nbd/server: Quiesce coroutines on context switch Eric Blake
2021-01-21  5:57   ` Sergio Lopez

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).