All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] block: new bdrv_drain implementation
@ 2016-10-07 16:19 Paolo Bonzini
  2016-10-07 16:19 ` [Qemu-devel] [PATCH 1/3] block: add BDS field to count in-flight requests Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Paolo Bonzini @ 2016-10-07 16:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, kwolf, famz, qemu-block

Another tiny bit from the multiqueue series.  This takes care of
reimplementing bdrv_drain to process each BDS in the tree in order.
A side effect is to separate draining of data writes from draining
of metadata writes, which allows us to reinstate QED's .bdrv_drain
implementation.

A couple words on the role of this in the multiqueue world.  This series
is half of what's needed to remove RFifoLock and contention callbacks.
In order to do so, aio_poll will only run in the I/O thread; when the
main QEMU thread wants to drain a BlockDriverState it will rely on the
I/O thread to do the work.  in_flight then provides a quick way to detect
whether to wake up a thread sitting in bdrv_drain.

Compared to previous attempts, the main change is that some tracking
has to be done at the BlockBackend level, because throttling has been moved
there.

This series requires:
- "replication: interrupt failover if the main device is closed"
- "blockjob: introduce .drain callback for jobs"

The next (already written) steps are:
- "aio: convert from RFifoLock to QemuRecMutex"
- "aio: push aio_context_acquire/release down to dispatching"
- "aio: explicitly acquire aiocontext in all callbacks"
- "coroutine-lock: make it thread-safe"
- "block: make BlockDriverState fields thread-safe"

In total these are about 60 patches.  I plan to merge the first into
2.8 as a bugfix.  Further (planned) steps are:
- blockjob: do not protect with AioContext lock
  This is just using a QemuMutex to protect BlockJob fields
- block drivers: make them thread-safe
  This ensures everything is protected by the CoMutex or,
  for AIO-based drivers, by a QemuMutex.
- block: remove bdrv_set_aio_context

Paolo

Fam Zheng (1):
  qed: Implement .bdrv_drain

Paolo Bonzini (2):
  block: add BDS field to count in-flight requests
  block: change drain to look only at one child at a time

 block/block-backend.c     |  17 ++++++-
 block/io.c                | 127 ++++++++++++++++++++++++++++++++--------------
 block/qed.c               |  16 +++++-
 include/block/block_int.h |  10 ++--
 4 files changed, 124 insertions(+), 46 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2016-10-12 10:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-07 16:19 [Qemu-devel] [PATCH 0/3] block: new bdrv_drain implementation Paolo Bonzini
2016-10-07 16:19 ` [Qemu-devel] [PATCH 1/3] block: add BDS field to count in-flight requests Paolo Bonzini
2016-10-10 10:36   ` Kevin Wolf
2016-10-10 16:37     ` Paolo Bonzini
2016-10-11 11:00       ` Kevin Wolf
2016-10-11 14:09         ` Paolo Bonzini
2016-10-11 15:25           ` Kevin Wolf
2016-10-11 16:45             ` Paolo Bonzini
2016-10-12  9:50               ` Kevin Wolf
2016-10-12 10:13                 ` Paolo Bonzini
2016-10-07 16:19 ` [Qemu-devel] [PATCH 2/3] block: change drain to look only at one child at a time Paolo Bonzini
2016-10-10 11:17   ` Kevin Wolf
2016-10-07 16:19 ` [Qemu-devel] [PATCH 3/3] qed: Implement .bdrv_drain Paolo Bonzini
2016-10-11 16:46 ` [Qemu-devel] [PATCH 0/3] block: new bdrv_drain implementation no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.