qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] block-copy: make helper APIs thread safe
@ 2021-05-18  9:40 Emanuele Giuseppe Esposito
  2021-05-18  9:40 ` [PATCH v2 1/5] ratelimit: treat zero speed as unlimited Emanuele Giuseppe Esposito
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Emanuele Giuseppe Esposito @ 2021-05-18  9:40 UTC (permalink / raw)
  To: qemu-block
  Cc: Kevin Wolf, Emanuele Giuseppe Esposito,
	Vladimir Sementsov-Ogievskiy, qemu-devel, Max Reitz,
	Stefan Hajnoczi, Paolo Bonzini, John Snow

This serie of patches bring thread safety to the smaller APIs used by
block-copy, namely ratelimit, progressmeter, co-shared-resource
and aiotask.
The end goal is to reduce the usage of AioContexlock in block-copy,
by introducing smaller granularity locks thus on making the block layer
thread safe. 

This serie depends on Paolo's coroutine_sleep API.

What's missing for block-copy to be fully thread-safe is fixing
the CoSleep API to allow cross-thread sleep and wakeup.
Paolo is working on it and will post the patches once his new
CoSleep API is accepted.

Patches 1-3 work on ratelimit (they are also based on the first
ratelimit patch sent by Paolo), 4 covers progressmeter and
5 co-shared-resources.

Based-on: <20210503112550.478521-1-pbonzini@redhat.com>
Based-on: <20210413125533.217440-1-pbonzini@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
v1 -> v2:
* Implement progressmeter as a separate .c file (was just an header),
  but keep the struct public, to avoid heap allocations [Vladimir, Paolo]
* Drop for now the Aiopool patches of v2 [Paolo, Stefan]

Emanuele Giuseppe Esposito (2):
  progressmeter: protect with a mutex
  co-shared-resource: protect with a mutex

Paolo Bonzini (3):
  ratelimit: treat zero speed as unlimited
  block-copy: let ratelimit handle a speed of 0
  blockjob: let ratelimit handle a speed of 0

 block/block-copy.c                | 28 ++++++--------
 block/meson.build                 |  1 +
 block/progress_meter.c            | 64 +++++++++++++++++++++++++++++++
 blockjob.c                        | 46 +++++++++++++---------
 include/qemu/co-shared-resource.h |  4 +-
 include/qemu/progress_meter.h     | 34 ++++++++--------
 include/qemu/ratelimit.h          | 12 +++++-
 job-qmp.c                         |  8 +++-
 job.c                             |  3 ++
 qemu-img.c                        |  9 +++--
 util/qemu-co-shared-resource.c    | 27 ++++++++++---
 11 files changed, 171 insertions(+), 65 deletions(-)
 create mode 100644 block/progress_meter.c

-- 
2.30.2



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

end of thread, other threads:[~2021-05-31 14:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18  9:40 [PATCH v2 0/5] block-copy: make helper APIs thread safe Emanuele Giuseppe Esposito
2021-05-18  9:40 ` [PATCH v2 1/5] ratelimit: treat zero speed as unlimited Emanuele Giuseppe Esposito
2021-05-18  9:40 ` [PATCH v2 2/5] block-copy: let ratelimit handle a speed of 0 Emanuele Giuseppe Esposito
2021-05-18  9:40 ` [PATCH v2 3/5] blockjob: " Emanuele Giuseppe Esposito
2021-05-18  9:40 ` [PATCH v2 4/5] progressmeter: protect with a mutex Emanuele Giuseppe Esposito
2021-05-18 10:00   ` Vladimir Sementsov-Ogievskiy
2021-05-18 10:14     ` Emanuele Giuseppe Esposito
2021-05-31 14:24       ` Stefan Hajnoczi
2021-05-18  9:40 ` [PATCH v2 5/5] co-shared-resource: " Emanuele Giuseppe Esposito
2021-05-18 14:50   ` Vladimir Sementsov-Ogievskiy

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).