All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/15] block: AioContext management, part 2
@ 2019-05-23 16:00 Kevin Wolf
  2019-05-23 16:00 ` [Qemu-devel] [PATCH 01/15] test-block-iothread: Check filter node in test_propagate_mirror Kevin Wolf
                   ` (17 more replies)
  0 siblings, 18 replies; 22+ messages in thread
From: Kevin Wolf @ 2019-05-23 16:00 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel, mreitz

Recently, a few bugs were reported that resulted from an inconsistent
state regarding AioContexts. Block nodes can end up in different
contexts than their users expect - the AioContext of a node can even
change under the feet of a device with no way for the device to forbid
this. We recently added a few basic checks to scsi-disk and virtio-blk,
but they are by far not enough.

Part 1 solved the first half of the problem and made sure that
AioContext changes are propagated through the graph as necessary, so
that a bdrv_set_aio_context() correctly pulls everything that uses the
node into the right context.

This is part 2 that fixes the second half: Attaching new child nodes
where the parent and child are already in different AioContexts. This
operation may only succeed if we can move one of the node into the
context of the other node.

After applying this series, unchecked bdrv_set_aio_context() doesn't
exist any more and all users call functions that make sure that the
AioContext assignments across the graph stays consistent.

Kevin Wolf (15):
  test-block-iothread: Check filter node in test_propagate_mirror
  block: Add Error to blk_set_aio_context()
  block: Add BlockBackend.ctx
  block: Add qdev_prop_drive_iothread property type
  scsi-disk: Use qdev_prop_drive_iothread
  block: Adjust AioContexts when attaching nodes
  test-block-iothread: Test adding parent to iothread node
  test-block-iothread: BlockBackend AioContext across root node change
  block: Move node without parents to main AioContext
  blockdev: Use bdrv_try_set_aio_context() for monitor commands
  block: Remove wrong bdrv_set_aio_context() calls
  virtio-scsi-test: Test attaching new overlay with iothreads
  iotests: Attach new devices to node in non-default iothread
  test-bdrv-drain: Use bdrv_try_set_aio_context()
  block: Remove bdrv_set_aio_context()

 docs/devel/multiple-iothreads.txt |   4 +-
 include/block/block.h             |   9 ---
 include/block/block_int.h         |   1 +
 include/hw/block/block.h          |   7 +-
 include/hw/qdev-properties.h      |   3 +
 include/hw/scsi/scsi.h            |   1 +
 include/sysemu/block-backend.h    |   5 +-
 tests/libqtest.h                  |  11 ++++
 block.c                           |  70 ++++++++++++++------
 block/backup.c                    |   3 +-
 block/block-backend.c             |  47 +++++++++-----
 block/commit.c                    |  13 ++--
 block/crypto.c                    |   3 +-
 block/mirror.c                    |   4 +-
 block/parallels.c                 |   3 +-
 block/qcow.c                      |   3 +-
 block/qcow2.c                     |   6 +-
 block/qed.c                       |   3 +-
 block/sheepdog.c                  |   3 +-
 block/vdi.c                       |   3 +-
 block/vhdx.c                      |   3 +-
 block/vmdk.c                      |   3 +-
 block/vpc.c                       |   3 +-
 blockdev.c                        |  48 ++++++++------
 blockjob.c                        |  12 +++-
 hmp.c                             |   3 +-
 hw/block/dataplane/virtio-blk.c   |  12 +++-
 hw/block/dataplane/xen-block.c    |   6 +-
 hw/block/fdc.c                    |   2 +-
 hw/block/xen-block.c              |   2 +-
 hw/core/qdev-properties-system.c  |  41 +++++++++++-
 hw/ide/qdev.c                     |   2 +-
 hw/scsi/scsi-disk.c               |  24 ++++---
 hw/scsi/virtio-scsi.c             |  25 ++++---
 migration/block.c                 |   3 +-
 nbd/server.c                      |   5 +-
 tests/libqtest.c                  |  19 ++++++
 tests/test-bdrv-drain.c           |  50 +++++++-------
 tests/test-bdrv-graph-mod.c       |   5 +-
 tests/test-block-backend.c        |   4 +-
 tests/test-block-iothread.c       | 104 +++++++++++++++++++++++++-----
 tests/test-blockjob.c             |   2 +-
 tests/test-throttle.c             |   6 +-
 tests/virtio-scsi-test.c          |  62 ++++++++++++++++++
 tests/qemu-iotests/051            |  24 +++++++
 tests/qemu-iotests/051.out        |   3 +
 tests/qemu-iotests/051.pc.out     |  27 ++++++++
 tests/qemu-iotests/240.out        |   2 +-
 48 files changed, 531 insertions(+), 173 deletions(-)

-- 
2.20.1



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

end of thread, other threads:[~2019-06-03 13:20 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 16:00 [Qemu-devel] [PATCH 00/15] block: AioContext management, part 2 Kevin Wolf
2019-05-23 16:00 ` [Qemu-devel] [PATCH 01/15] test-block-iothread: Check filter node in test_propagate_mirror Kevin Wolf
2019-05-24 12:25   ` Eric Blake
2019-05-23 16:00 ` [Qemu-devel] [PATCH 02/15] block: Add Error to blk_set_aio_context() Kevin Wolf
2019-05-23 16:00 ` [Qemu-devel] [PATCH 03/15] block: Add BlockBackend.ctx Kevin Wolf
2019-05-23 16:00 ` [Qemu-devel] [PATCH 04/15] block: Add qdev_prop_drive_iothread property type Kevin Wolf
2019-05-23 16:00 ` [Qemu-devel] [PATCH 05/15] scsi-disk: Use qdev_prop_drive_iothread Kevin Wolf
2019-05-23 16:00 ` [Qemu-devel] [PATCH 06/15] block: Adjust AioContexts when attaching nodes Kevin Wolf
2019-05-23 16:00 ` [Qemu-devel] [PATCH 07/15] test-block-iothread: Test adding parent to iothread node Kevin Wolf
2019-05-24 12:24   ` Eric Blake
2019-05-23 16:00 ` [Qemu-devel] [PATCH 08/15] test-block-iothread: BlockBackend AioContext across root node change Kevin Wolf
2019-05-23 16:00 ` [Qemu-devel] [PATCH 09/15] block: Move node without parents to main AioContext Kevin Wolf
2019-05-23 16:00 ` [Qemu-devel] [PATCH 10/15] blockdev: Use bdrv_try_set_aio_context() for monitor commands Kevin Wolf
2019-05-23 16:01 ` [Qemu-devel] [PATCH 11/15] block: Remove wrong bdrv_set_aio_context() calls Kevin Wolf
2019-05-23 16:01 ` [Qemu-devel] [PATCH 12/15] virtio-scsi-test: Test attaching new overlay with iothreads Kevin Wolf
2019-05-23 16:01 ` [Qemu-devel] [PATCH 13/15] iotests: Attach new devices to node in non-default iothread Kevin Wolf
2019-05-23 16:01 ` [Qemu-devel] [PATCH 14/15] test-bdrv-drain: Use bdrv_try_set_aio_context() Kevin Wolf
2019-05-23 16:01 ` [Qemu-devel] [PATCH 15/15] block: Remove bdrv_set_aio_context() Kevin Wolf
2019-05-23 19:44 ` [Qemu-devel] [PATCH 00/15] block: AioContext management, part 2 no-reply
2019-05-24  8:57 ` [Qemu-devel] [PATCH 1.5/15] nbd-server: Call blk_set_allow_aio_context_change() Kevin Wolf
2019-05-24 12:27   ` Eric Blake
2019-06-03 13:19 ` [Qemu-devel] [PATCH 00/15] block: AioContext management, part 2 Kevin Wolf

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.