qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Fix "stop" draining block jobs
@ 2015-04-03 10:38 Fam Zheng
  2015-04-03 10:39 ` [Qemu-devel] [PATCH 1/3] blockjob: Don't sleep meaninglessly short Fam Zheng
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Fam Zheng @ 2015-04-03 10:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Kevin Wolf, berto, qemu-block, Jeff Cody, Stefan Hajnoczi,
	pbonzini

Stopping the vm will drive the block job all the way to the end, because the
sleep duration is too short, which means the block_job_sleep_ns in the block
jobs are unhelpful. That is because the timer will fire too soon, even before
the aio_poll in bdrv_drain_all returns.

Lengthen the sleep and add a test case to catch this issue in the future.

It's not perfect, because the aio_poll returning point could still be far
enough that we wake up the job earlier, but this patch is already making it
better in common cases - setting up a timer with timeout=0 was definitely too
short anyway.

A complete solution would be adding a "sleep until next iteration" timer/BH
API, but I'm not sure that is worth the complexity.

Please review!

Fam

Fam Zheng (3):
  blockjob: Don't sleep meaninglessly short
  qemu-iotests: Test that "stop" doesn't drain block jobs
  blockjob: Update function name in comments

 block/backup.c             |  2 +-
 block/mirror.c             |  2 +-
 blockjob.c                 |  3 +-
 include/block/blockjob.h   |  6 +++-
 tests/qemu-iotests/129     | 86 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/129.out |  5 +++
 tests/qemu-iotests/group   |  1 +
 7 files changed, 101 insertions(+), 4 deletions(-)
 create mode 100644 tests/qemu-iotests/129
 create mode 100644 tests/qemu-iotests/129.out

-- 
2.1.0

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

end of thread, other threads:[~2015-04-03 12:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-03 10:38 [Qemu-devel] [PATCH 0/3] Fix "stop" draining block jobs Fam Zheng
2015-04-03 10:39 ` [Qemu-devel] [PATCH 1/3] blockjob: Don't sleep meaninglessly short Fam Zheng
2015-04-03 10:39 ` [Qemu-devel] [PATCH 2/3] qemu-iotests: Test that "stop" doesn't drain block jobs Fam Zheng
2015-04-03 10:39 ` [Qemu-devel] [PATCH 3/3] blockjob: Update function name in comments Fam Zheng
2015-04-03 11:10 ` [Qemu-devel] [PATCH 0/3] Fix "stop" draining block jobs Paolo Bonzini
2015-04-03 12:30   ` Fam Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).