All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/14] Fix some jobs/drain/aio_poll related hangs
@ 2018-09-07 16:15 Kevin Wolf
  2018-09-07 16:15 ` [Qemu-devel] [PATCH 01/14] blockjob: Wake up BDS when job becomes idle Kevin Wolf
                   ` (13 more replies)
  0 siblings, 14 replies; 33+ messages in thread
From: Kevin Wolf @ 2018-09-07 16:15 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, mreitz, famz, pbonzini, slp, qemu-devel

Especially the combination of iothreads, block jobs and drain tends to
lead to hangs currently. This series fixes a few of these bugs, although
there are more of them, to be addressed in separate patches.

The primary goal of this series is to fix the scenario from:
https://bugzilla.redhat.com/show_bug.cgi?id=1601212

A simplified reproducer of the reported problem looks like this (two concurrent
commit block jobs for disks in an iothread):

$qemu -qmp stdio \
    -object iothread,id=iothread1 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x6,iothread=iothread1 \
    -drive  id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=hd0 \
    -device scsi-hd,drive=drive_image1,id=image1,bootindex=1 \
    -drive  id=drive_image2,if=none,snapshot=off,aio=threads,cache=none,format=qcow2,file=hd1 \
    -device scsi-hd,drive=drive_image2,id=image2,bootindex=2

{"execute":"qmp_capabilities"}
{"execute":"blockdev-snapshot-sync","arguments":{"device":"drive_image1","snapshot-file":"sn1"}}
{"execute":"blockdev-snapshot-sync","arguments":{"device":"drive_image1","snapshot-file":"sn11"}}
{"execute":"blockdev-snapshot-sync","arguments":{"device":"drive_image1","snapshot-file":"sn111"}}
{"execute":"blockdev-snapshot-sync","arguments":{"device":"drive_image2","snapshot-file":"sn2"}}
{"execute":"blockdev-snapshot-sync","arguments":{"device":"drive_image2","snapshot-file":"sn22"}}
{"execute":"blockdev-snapshot-sync","arguments":{"device":"drive_image2","snapshot-file":"sn222"}}

{ "execute": "block-commit", "arguments": { "device": "drive_image2","base":"sn2","backing-file":"sn2","top":"sn22"}}
{ "execute": "block-commit", "arguments": { "device": "drive_image1","base":"sn1","backing-file":"sn1","top":"sn11"}}

{"execute":"quit"}

Kevin Wolf (14):
  blockjob: Wake up BDS when job becomes idle
  test-bdrv-drain: Drain with block jobs in an I/O thread
  test-blockjob: Acquire AioContext around job_finish_sync()
  job: Use AIO_WAIT_WHILE() in job_finish_sync()
  test-bdrv-drain: Test AIO_WAIT_WHILE() in completion callback
  block: Add missing locking in bdrv_co_drain_bh_cb()
  aio-wait: Increase num_waiters even in home thread
  block-backend: Add .drained_poll callback
  block-backend: Fix potential double blk_delete()
  block-backend: Decrease in_flight only after callback
  mirror: Fix potential use-after-free in active commit
  blockjob: Lie better in child_job_drained_poll()
  block: Remove aio_poll() in bdrv_drain_poll variants
  test-bdrv-drain: Test nested poll in bdrv_drain_poll_top_level()

 include/block/aio-wait.h |   2 +
 include/block/blockjob.h |  13 ++++++
 include/qemu/coroutine.h |   5 +++
 include/qemu/job.h       |  12 ++++++
 block/block-backend.c    |  26 ++++++++++-
 block/io.c               |  23 ++++++----
 block/mirror.c           |   9 ++++
 blockjob.c               |  20 ++++++++-
 job.c                    |  29 +++++++++----
 tests/test-bdrv-drain.c  | 110 ++++++++++++++++++++++++++++++++++++++++++++---
 tests/test-blockjob.c    |   6 +++
 util/qemu-coroutine.c    |   5 +++
 12 files changed, 235 insertions(+), 25 deletions(-)

-- 
2.13.6

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

end of thread, other threads:[~2018-09-11 10:22 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-07 16:15 [Qemu-devel] [PATCH 00/14] Fix some jobs/drain/aio_poll related hangs Kevin Wolf
2018-09-07 16:15 ` [Qemu-devel] [PATCH 01/14] blockjob: Wake up BDS when job becomes idle Kevin Wolf
2018-09-11  7:58   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 02/14] test-bdrv-drain: Drain with block jobs in an I/O thread Kevin Wolf
2018-09-11  8:09   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 03/14] test-blockjob: Acquire AioContext around job_finish_sync() Kevin Wolf
2018-09-11  8:11   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 04/14] job: Use AIO_WAIT_WHILE() in job_finish_sync() Kevin Wolf
2018-09-11  8:17   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 05/14] test-bdrv-drain: Test AIO_WAIT_WHILE() in completion callback Kevin Wolf
2018-09-11  8:17   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 06/14] block: Add missing locking in bdrv_co_drain_bh_cb() Kevin Wolf
2018-09-11  8:23   ` Fam Zheng
2018-09-11  9:17     ` Kevin Wolf
2018-09-11  9:28       ` Sergio Lopez
2018-09-11 10:22         ` Kevin Wolf
2018-09-07 16:15 ` [Qemu-devel] [PATCH 07/14] aio-wait: Increase num_waiters even in home thread Kevin Wolf
2018-09-11  8:25   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 08/14] block-backend: Add .drained_poll callback Kevin Wolf
2018-09-11  8:26   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 09/14] block-backend: Fix potential double blk_delete() Kevin Wolf
2018-09-11  8:27   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 10/14] block-backend: Decrease in_flight only after callback Kevin Wolf
2018-09-11  8:29   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 11/14] mirror: Fix potential use-after-free in active commit Kevin Wolf
2018-09-11  8:31   ` Fam Zheng
2018-09-11  9:32     ` Kevin Wolf
2018-09-07 16:15 ` [Qemu-devel] [PATCH 12/14] blockjob: Lie better in child_job_drained_poll() Kevin Wolf
2018-09-11  8:34   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 13/14] block: Remove aio_poll() in bdrv_drain_poll variants Kevin Wolf
2018-09-11  8:35   ` Fam Zheng
2018-09-07 16:15 ` [Qemu-devel] [PATCH 14/14] test-bdrv-drain: Test nested poll in bdrv_drain_poll_top_level() Kevin Wolf
2018-09-11  8:37   ` Fam Zheng

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.