Skip to content

block-copy: make helper APIs thread safe

Emanuele Giuseppe Esposito qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest posting 2/22 of 5 patches 1 replyIn review
  2. v3 posting 1/25 patches 6 repliesApplied
  3. v25 patches 4 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v16 patches28 repliesSuperseded

Changes in v3 from the cover letter

* Rebase on current master (had conflicts in block-copy), remove based-on in cover letter

2 of 5 patches are in this archive. The cover letter announces 5.

Patches in v3 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5ratelimit: treat zero speed as unlimitedinclude/qemu/ratelimit.h+10 -20 replies
2/5block-copy: let ratelimit handle a speed of 0block/block-copy.c+11 -170 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchVladimir Sementsov-Ogievskiy
1/5R-b
2/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/5] block-copy: make helper APIs thread safe

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.

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, 4 covers progressmeter and 5 co-shared-resources.

---
v3:
* Rebase on current master (had conflicts in block-copy), remove based-on in cover letter

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    | 24 +++++++++---
 11 files changed, 168 insertions(+), 65 deletions(-)
 create mode 100644 block/progress_meter.c
Signature · 1 line
2.31.1