All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/7] blockjob: refactor mirror_throttle
@ 2017-12-14  0:59 John Snow
  2017-12-14  0:59 ` [Qemu-devel] [PATCH 1/7] blockjob: record time of last yield John Snow
                   ` (6 more replies)
  0 siblings, 7 replies; 29+ messages in thread
From: John Snow @ 2017-12-14  0:59 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, jcody, qemu-devel, stefanha, mreitz, John Snow

mirror_throttle attempts to make sure we yield every so often when we're
doing operations that may not otherwise be as cooperative as we'd like.

This pattern is useful to other jobs like commit as well; if commit
continuously decides not to copy data (and calculates delay_ns to be 0),
we'll frequently and aggressively yield, only to be rescheduled immediately.

This causes those "WARNING: I/O thread spun for 1000 iterations"
warnings that everyone loves so much.

Split out the mirror_throttle function to become a new internal
BlockJob API function, block_job_throttle; then use it for all
the other jobs in their runtime loops.

I decided to use it in stream and backup as well, so that regardless of if the
loop structure has the chance to be greedy or not (I did not audit this), the
BlockJob has some kind of failsafe that will occasionally perform a 0ns sleep
every SLICE_TIME.

________________________________________________________________________________

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

This version is tagged block-job-yield-v1:
https://github.com/jnsnow/qemu/releases/tag/block-job-yield-v1

John Snow (7):
  blockjob: record time of last yield
  blockjob: consolidate SLICE_TIME definition
  blockjob: create block_job_throttle
  blockjob: allow block_job_throttle to take delay_ns
  block/commit: use block_job_throttle
  block/stream: use block_job_throttle
  block/backup: use block_job_throttle

 block/backup.c               | 12 ++++++------
 block/commit.c               |  5 ++---
 block/mirror.c               | 22 +++-------------------
 block/stream.c               |  4 +---
 blockjob.c                   | 12 ++++++++++++
 include/block/blockjob.h     |  5 +++++
 include/block/blockjob_int.h | 15 +++++++++++++++
 7 files changed, 44 insertions(+), 31 deletions(-)

-- 
2.14.3

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

end of thread, other threads:[~2018-01-02 21:23 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-14  0:59 [Qemu-devel] [PATCH 0/7] blockjob: refactor mirror_throttle John Snow
2017-12-14  0:59 ` [Qemu-devel] [PATCH 1/7] blockjob: record time of last yield John Snow
2017-12-14  8:38   ` Paolo Bonzini
2017-12-14 15:55     ` John Snow
2017-12-18 14:22       ` Stefan Hajnoczi
2017-12-14  0:59 ` [Qemu-devel] [PATCH 2/7] blockjob: consolidate SLICE_TIME definition John Snow
2017-12-14  8:51   ` Paolo Bonzini
2017-12-18 14:23   ` Stefan Hajnoczi
2018-01-02 20:29   ` Jeff Cody
2017-12-14  0:59 ` [Qemu-devel] [PATCH 3/7] blockjob: create block_job_throttle John Snow
2017-12-14  8:39   ` Paolo Bonzini
2017-12-14 15:57     ` John Snow
2017-12-18 14:27   ` Stefan Hajnoczi
2018-01-02 21:23   ` Jeff Cody
2017-12-14  0:59 ` [Qemu-devel] [PATCH 4/7] blockjob: allow block_job_throttle to take delay_ns John Snow
2017-12-14  8:49   ` Paolo Bonzini
2017-12-14 16:06     ` John Snow
2017-12-14 17:21       ` Paolo Bonzini
2017-12-14 17:22         ` John Snow
2017-12-14 17:23           ` Paolo Bonzini
2017-12-14  0:59 ` [Qemu-devel] [PATCH 5/7] block/commit: use block_job_throttle John Snow
2017-12-14  8:50   ` Paolo Bonzini
2017-12-18 14:29   ` Stefan Hajnoczi
2017-12-14  0:59 ` [Qemu-devel] [PATCH 6/7] block/stream: " John Snow
2017-12-14  8:50   ` Paolo Bonzini
2017-12-18 14:29   ` Stefan Hajnoczi
2017-12-14  0:59 ` [Qemu-devel] [PATCH 7/7] block/backup: " John Snow
2017-12-14  8:50   ` Paolo Bonzini
2017-12-18 14:29   ` Stefan Hajnoczi

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.