[PATCH v4 0/6] block-copy: protect block-copy internal structures

Emanuele Giuseppe Esposito posted 6 patches 2 years, 10 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
block/block-copy.c         | 327 ++++++++++++++++++++++---------------
include/block/block-copy.h |   2 +
2 files changed, 197 insertions(+), 132 deletions(-)
[PATCH v4 0/6] block-copy: protect block-copy internal structures
Posted by Emanuele Giuseppe Esposito 2 years, 10 months ago
This serie of patches aims to reduce the usage of the
AioContexlock in block-copy, by introducing smaller granularity
locks thus on making the block layer thread safe. 

This serie depends on my previous serie that brings thread safety
to the smaller API used by block-copy, like ratelimit, progressmeter
abd co-shared-resource.

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.

Patch 1 provides a small refactoring, patch 2 introduces the 
.method field in BlockCopyState, to be used instead of .use_copy_range,
.copy_size and .zeros.
Patch 3-4 provide comments and refactoring in preparation to
the lock added in patch 5 on BlockCopyTask, BlockCopyCallState and
BlockCopyState. Patch 6 uses load_acquire/store_release to make sure
BlockCopyCallState OUT fields are updated before finished is set to
true. 

Based-on: <20210518094058.25952-1-eesposit@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
v4:
* Introduce patch 1 (refactoring)
* Adjust to Vladimir's style comments in patch 2 [Paolo, Vladimir]
* Extend the lock to cover an additional race condition in
  block_copy_common [Vladimir]

Emanuele Giuseppe Esposito (5):
  block-copy: small refactor in block_copy_task_entry and
    block_copy_common
  block-copy: improve comments of BlockCopyTask and BlockCopyState types
    and functions
  block-copy: move progress_set_remaining in block_copy_task_end
  block-copy: add a CoMutex
  block-copy: atomic .cancelled and .finished fields in
    BlockCopyCallState

Paolo Bonzini (1):
  block-copy: streamline choice of copy_range vs. read/write

 block/block-copy.c         | 327 ++++++++++++++++++++++---------------
 include/block/block-copy.h |   2 +
 2 files changed, 197 insertions(+), 132 deletions(-)

-- 
2.31.1