All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/6] block-copy: protect block-copy internal structures
@ 2021-06-14  7:33 Emanuele Giuseppe Esposito
  2021-06-14  7:33 ` [PATCH v4 1/6] block-copy: small refactor in block_copy_task_entry and block_copy_common Emanuele Giuseppe Esposito
                   ` (5 more replies)
  0 siblings, 6 replies; 30+ messages in thread
From: Emanuele Giuseppe Esposito @ 2021-06-14  7:33 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 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



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

end of thread, other threads:[~2021-06-23 10:07 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-14  7:33 [PATCH v4 0/6] block-copy: protect block-copy internal structures Emanuele Giuseppe Esposito
2021-06-14  7:33 ` [PATCH v4 1/6] block-copy: small refactor in block_copy_task_entry and block_copy_common Emanuele Giuseppe Esposito
2021-06-19 14:33   ` Vladimir Sementsov-Ogievskiy
2021-06-14  7:33 ` [PATCH v4 2/6] block-copy: streamline choice of copy_range vs. read/write Emanuele Giuseppe Esposito
2021-06-19 15:05   ` Vladimir Sementsov-Ogievskiy
2021-06-19 18:23   ` Vladimir Sementsov-Ogievskiy
2021-06-14  7:33 ` [PATCH v4 3/6] block-copy: improve comments of BlockCopyTask and BlockCopyState types and functions Emanuele Giuseppe Esposito
2021-06-19 15:23   ` Vladimir Sementsov-Ogievskiy
2021-06-19 18:31     ` Vladimir Sementsov-Ogievskiy
2021-06-21  8:13       ` Emanuele Giuseppe Esposito
2021-06-22  9:20         ` Vladimir Sementsov-Ogievskiy
2021-06-21  7:59     ` Emanuele Giuseppe Esposito
2021-06-22  9:16       ` Vladimir Sementsov-Ogievskiy
2021-06-19 17:27   ` Vladimir Sementsov-Ogievskiy
2021-06-21  8:21     ` Emanuele Giuseppe Esposito
2021-06-19 18:53   ` Vladimir Sementsov-Ogievskiy
2021-06-21  8:28     ` Emanuele Giuseppe Esposito
2021-06-14  7:33 ` [PATCH v4 4/6] block-copy: move progress_set_remaining in block_copy_task_end Emanuele Giuseppe Esposito
2021-06-14  7:33 ` [PATCH v4 5/6] block-copy: add a CoMutex Emanuele Giuseppe Esposito
2021-06-19 19:34   ` Vladimir Sementsov-Ogievskiy
2021-06-14  7:33 ` [PATCH v4 6/6] block-copy: atomic .cancelled and .finished fields in BlockCopyCallState Emanuele Giuseppe Esposito
2021-06-19 20:06   ` Vladimir Sementsov-Ogievskiy
2021-06-21  9:30     ` Emanuele Giuseppe Esposito
2021-06-22  9:56       ` Vladimir Sementsov-Ogievskiy
2021-06-22  8:15     ` Paolo Bonzini
2021-06-22  9:36       ` Vladimir Sementsov-Ogievskiy
2021-06-22 10:20         ` Paolo Bonzini
2021-06-22 10:39           ` Vladimir Sementsov-Ogievskiy
2021-06-22 20:57             ` Emanuele Giuseppe Esposito
2021-06-23 10:06             ` Paolo Bonzini

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.