All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 00/11] blockjobs: Fix transactional race condition
@ 2016-09-30 22:00 John Snow
  2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 01/11] blockjob: fix dead pointer in txn list John Snow
                   ` (11 more replies)
  0 siblings, 12 replies; 51+ messages in thread
From: John Snow @ 2016-09-30 22:00 UTC (permalink / raw)
  To: qemu-block
  Cc: kwolf, vsementsov, famz, stefanha, jcody, eblake, qemu-devel, John Snow

There are a few problems with transactional job completion right now.

First, if jobs complete so quickly they complete before remaining jobs
get a chance to join the transaction, the completion mode can leave well
known state and the QLIST can get corrupted and the transactional jobs
can complete in batches or phases instead of all together.

Second, if two or more jobs defer to the main loop at roughly the same
time, it's possible for one job's cleanup to directly invoke the other
job's cleanup from within the same thread, leading to a situation that
will deadlock the entire transaction.

Thanks to Vladimir for pointing out these modes of failure.

This series also does a little digging into refactoring Jobs into public
and private interfaces. It's somewhat unrelated, but it was easier to
include this with this series than separate it out and send it later.
This comprises patches 2-6. The actual fixes here are in patches 1 and
7-10. A new test to catch Vladimir's failure scenario is in patch 11.

v2:
 - Lots of differences in patches 2-9.
 - Cancel should now work on an "unstarted" blockjob.
 - New refactoring patches.
 - Added "start" property for BlockJob Drivers.

________________________________________________________________________________

For convenience, this branch is available at:
https://github.com/jnsnow/qemu.git branch job-manual-start
https://github.com/jnsnow/qemu/tree/job-manual-start

This version is tagged job-manual-start-v2:
https://github.com/jnsnow/qemu/releases/tag/job-manual-start-v2

John Snow (10):
  blockjob: centralize QMP event emissions
  Blockjobs: Internalize user_pause logic
  blockjobs: Always use block_job_get_aio_context
  blockjobs: split interface into public/private
  blockjobs: fix documentation
  blockjob: add .clean property
  blockjob: add .start field
  blockjob: add block_job_start
  blockjob: refactor backup_start as backup_job_create
  iotests: add transactional failure race test

Vladimir Sementsov-Ogievskiy (1):
  blockjob: fix dead pointer in txn list

 block/backup.c               |  59 ++++---
 block/commit.c               |   6 +-
 block/io.c                   |   6 +-
 block/mirror.c               |   7 +-
 block/replication.c          |  13 +-
 block/stream.c               |   6 +-
 blockdev.c                   | 128 +++++++--------
 blockjob.c                   |  72 +++++++--
 include/block/block.h        |   3 +-
 include/block/block_int.h    |  29 ++--
 include/block/blockjob.h     | 345 +++-------------------------------------
 include/block/blockjob_int.h | 366 +++++++++++++++++++++++++++++++++++++++++++
 qemu-img.c                   |   4 +-
 tests/qemu-iotests/124       |  91 +++++++++++
 tests/qemu-iotests/124.out   |   4 +-
 tests/test-blockjob-txn.c    |  14 +-
 tests/test-blockjob.c        |   2 +-
 17 files changed, 688 insertions(+), 467 deletions(-)
 create mode 100644 include/block/blockjob_int.h

-- 
2.7.4

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

end of thread, other threads:[~2016-10-17 18:00 UTC | newest]

Thread overview: 51+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-30 22:00 [Qemu-devel] [PATCH v2 00/11] blockjobs: Fix transactional race condition John Snow
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 01/11] blockjob: fix dead pointer in txn list John Snow
2016-10-05 13:43   ` Kevin Wolf
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 02/11] blockjob: centralize QMP event emissions John Snow
2016-10-05 13:43   ` Kevin Wolf
2016-10-05 18:49     ` John Snow
2016-10-05 19:24       ` Eric Blake
2016-10-05 21:00         ` John Snow
2016-10-10 16:45           ` Kashyap Chamarthy
2016-10-10 18:36             ` John Snow
2016-10-10 19:28               ` Eric Blake
2016-10-11 13:32                 ` Kashyap Chamarthy
2016-10-06  7:44       ` Kevin Wolf
2016-10-06 16:57         ` John Snow
2016-10-06 18:16           ` Eric Blake
2016-10-06 18:19             ` John Snow
2016-10-11  9:50       ` Markus Armbruster
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 03/11] Blockjobs: Internalize user_pause logic John Snow
2016-10-04  0:57   ` Jeff Cody
2016-10-04  2:46     ` John Snow
2016-10-04 18:35     ` John Snow
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 04/11] blockjobs: Always use block_job_get_aio_context John Snow
2016-10-05 14:02   ` Kevin Wolf
2016-10-06 20:22     ` John Snow
2016-10-07  7:49       ` Paolo Bonzini
2016-10-13  0:49         ` John Snow
2016-10-13  9:03           ` Paolo Bonzini
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 05/11] blockjobs: split interface into public/private John Snow
2016-10-05 14:17   ` Kevin Wolf
2016-10-05 16:20     ` John Snow
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 06/11] blockjobs: fix documentation John Snow
2016-10-05 15:03   ` Kevin Wolf
2016-10-05 16:22     ` John Snow
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 07/11] blockjob: add .clean property John Snow
2016-10-12 11:11   ` Vladimir Sementsov-Ogievskiy
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 08/11] blockjob: add .start field John Snow
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 09/11] blockjob: add block_job_start John Snow
2016-10-05 15:17   ` Kevin Wolf
2016-10-06 22:44     ` John Snow
2016-10-17 18:00       ` John Snow
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 10/11] blockjob: refactor backup_start as backup_job_create John Snow
2016-10-07 18:39   ` John Snow
2016-10-10  8:57     ` Kevin Wolf
2016-10-10 22:51       ` John Snow
2016-10-11  8:56         ` Paolo Bonzini
2016-10-11  9:35         ` Kevin Wolf
2016-10-17  8:59           ` Fam Zheng
2016-09-30 22:00 ` [Qemu-devel] [PATCH v2 11/11] iotests: add transactional failure race test John Snow
2016-10-12 11:26   ` Vladimir Sementsov-Ogievskiy
2016-10-12 16:09     ` John Snow
2016-09-30 22:22 ` [Qemu-devel] [PATCH v2 00/11] blockjobs: Fix transactional race condition 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.