mbox series

[v3,00/10] block: Delay poll when ending drained sections

Message ID 20190719092618.24891-1-mreitz@redhat.com (mailing list archive)
Headers show
Series block: Delay poll when ending drained sections | expand

Message

Max Reitz July 19, 2019, 9:26 a.m. UTC
Hi,

This series:

(1) Keeps patch 1, as the previous series, and

(2) Decides whether all *drained_end* functions should poll or not; as
    proposed by Kevin, all that should not poll now get a
    @drained_end_counter pointer, whose pointee they have to increment
    once for every background operation scheduled, and that background
    operation will decrement it once it settles.
    This allows functions that should poll to do so until the counter
    reaches 0, so they don’t have to poll after scheduling every single
    operation but can do so once in a place where it’s safe.

v3:
- Change the design as described above (drained_end_counter instead of a
  list of BdrvCoDrainData objects to poll)
- Added a test to test-bdrv-drain


git-backport-diff against v2:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/10:[----] [--] 'block: Introduce BdrvChild.parent_quiesce_counter'
002/10:[down] 'tests: Add job commit by drained_end test'
003/10:[down] 'block: Add @drained_end_counter to bdrv_drain_invoke()'
004/10:[down] 'block: Make bdrv_parent_drained_[^_]*() static'
005/10:[down] 'tests: Lock AioContexts in test-block-iothread'
006/10:[down] 'block: Only poll once in bdrv_drained_end()'
007/10:[down] 'tests: Extend commit by drained_end test'
008/10:[down] 'block: Loop unsafely in bdrv*drained_end()'
009/10:[----] [--] 'iotests: Add @has_quit to vm.shutdown()'
010/10:[----] [--] 'iotests: Test commit with a filter on the chain'


Max Reitz (10):
  block: Introduce BdrvChild.parent_quiesce_counter
  tests: Add job commit by drained_end test
  block: Add @drained_end_counter
  block: Make bdrv_parent_drained_[^_]*() static
  tests: Lock AioContexts in test-block-iothread
  block: Do not poll in bdrv_do_drained_end()
  tests: Extend commit by drained_end test
  block: Loop unsafely in bdrv*drained_end()
  iotests: Add @has_quit to vm.shutdown()
  iotests: Test commit with a filter on the chain

 include/block/block.h       |  42 +++++++----
 include/block/block_int.h   |  15 +++-
 block.c                     |  52 ++++++++-----
 block/block-backend.c       |   6 +-
 block/io.c                  | 134 +++++++++++++++++++++++---------
 blockjob.c                  |   2 +-
 tests/test-bdrv-drain.c     | 147 ++++++++++++++++++++++++++++++++++++
 tests/test-block-iothread.c |  40 ++++++----
 python/qemu/machine.py      |   5 +-
 tests/qemu-iotests/040      |  40 +++++++++-
 tests/qemu-iotests/040.out  |   4 +-
 tests/qemu-iotests/255      |   2 +-
 12 files changed, 397 insertions(+), 92 deletions(-)

Comments

Kevin Wolf July 19, 2019, 1:16 p.m. UTC | #1
Am 19.07.2019 um 11:26 hat Max Reitz geschrieben:
> Hi,
> 
> This series:
> 
> (1) Keeps patch 1, as the previous series, and
> 
> (2) Decides whether all *drained_end* functions should poll or not; as
>     proposed by Kevin, all that should not poll now get a
>     @drained_end_counter pointer, whose pointee they have to increment
>     once for every background operation scheduled, and that background
>     operation will decrement it once it settles.
>     This allows functions that should poll to do so until the counter
>     reaches 0, so they don’t have to poll after scheduling every single
>     operation but can do so once in a place where it’s safe.

Thanks, applied to the block branch.

Kevin