All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com
Subject: [Qemu-devel] [PATCH 00/15] block: AioContext management, part 2
Date: Thu, 23 May 2019 18:00:49 +0200	[thread overview]
Message-ID: <20190523160104.21258-1-kwolf@redhat.com> (raw)

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



             reply	other threads:[~2019-05-23 16:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-23 16:00 Kevin Wolf [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190523160104.21258-1-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.