qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] block-copy: protect block-copy internal structures
@ 2021-05-18 10:07 Emanuele Giuseppe Esposito
  2021-05-18 10:07 ` [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write Emanuele Giuseppe Esposito
                   ` (8 more replies)
  0 siblings, 9 replies; 48+ messages in thread
From: Emanuele Giuseppe Esposito @ 2021-05-18 10:07 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 global
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 and 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 and will post the patches once his new
CoSleep API is accepted.

Patch 1 introduces the .method field instead of .use_copy_range
and .copy_size, so that it can be later used as atomic.
Patch 2-3 provide comments and refactoring in preparation to
the locks added in patch 4 on BlockCopyTask, patch 5-6 on
BlockCopyCallState and 7 BlockCopyState.

Based-on: <20210517100548.28806-1-pbonzini@redhat.com>
Based-on: <20210518094058.25952-1-eesposit@redhat.com>
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
---
v1 -> v2:
* More field categorized as IN/State/OUT in the various struct, better
  documentation in the structs
* Fix a couple of places where I missed locks [Vladimir, Paolo]


Emanuele Giuseppe Esposito (6):
  block-copy: improve documentation of BlockCopyTask and BlockCopyState
    types and functions
  block-copy: move progress_set_remaining in block_copy_task_end
  block-copy: add a CoMutex to the BlockCopyTask list
  block-copy: add QemuMutex lock for BlockCopyCallState list
  block-copy: atomic .cancelled and .finished fields in
    BlockCopyCallState
  block-copy: protect BlockCopyState .method fields

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

 block/block-copy.c | 234 +++++++++++++++++++++++++++++----------------
 1 file changed, 150 insertions(+), 84 deletions(-)

-- 
2.30.2



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

end of thread, other threads:[~2021-05-28 12:48 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 10:07 [PATCH v2 0/7] block-copy: protect block-copy internal structures Emanuele Giuseppe Esposito
2021-05-18 10:07 ` [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write Emanuele Giuseppe Esposito
2021-05-20 14:42   ` Vladimir Sementsov-Ogievskiy
2021-05-20 15:06     ` Emanuele Giuseppe Esposito
2021-05-20 15:24       ` Vladimir Sementsov-Ogievskiy
2021-05-21 15:10     ` Paolo Bonzini
2021-05-21 15:48       ` Vladimir Sementsov-Ogievskiy
2021-05-21 16:43         ` Paolo Bonzini
2021-05-21 17:51       ` Vladimir Sementsov-Ogievskiy
2021-05-27  8:20   ` Stefan Hajnoczi
2021-05-27 19:04     ` Paolo Bonzini
2021-05-18 10:07 ` [PATCH v2 2/7] block-copy: improve documentation of BlockCopyTask and BlockCopyState types and functions Emanuele Giuseppe Esposito
2021-05-20 15:00   ` Vladimir Sementsov-Ogievskiy
2021-05-20 15:15     ` Emanuele Giuseppe Esposito
2021-05-18 10:07 ` [PATCH v2 3/7] block-copy: move progress_set_remaining in block_copy_task_end Emanuele Giuseppe Esposito
2021-05-20 15:03   ` Vladimir Sementsov-Ogievskiy
2021-05-18 10:07 ` [PATCH v2 4/7] block-copy: add a CoMutex to the BlockCopyTask list Emanuele Giuseppe Esposito
2021-05-20 15:19   ` Vladimir Sementsov-Ogievskiy
2021-05-25 10:07     ` Emanuele Giuseppe Esposito
2021-05-25 10:25       ` Vladimir Sementsov-Ogievskiy
2021-05-26 14:58         ` Paolo Bonzini
2021-05-26 16:13           ` Vladimir Sementsov-Ogievskiy
2021-05-27  9:07   ` Stefan Hajnoczi
2021-05-18 10:07 ` [PATCH v2 5/7] block-copy: add QemuMutex lock for BlockCopyCallState list Emanuele Giuseppe Esposito
2021-05-20 15:30   ` Vladimir Sementsov-Ogievskiy
2021-05-21 15:01     ` Paolo Bonzini
2021-05-25 10:58       ` Emanuele Giuseppe Esposito
2021-05-26 14:49         ` Paolo Bonzini
2021-05-28 10:53   ` Paolo Bonzini
2021-05-18 10:07 ` [PATCH v2 6/7] block-copy: atomic .cancelled and .finished fields in BlockCopyCallState Emanuele Giuseppe Esposito
2021-05-20 15:34   ` Vladimir Sementsov-Ogievskiy
2021-05-21 15:02     ` Paolo Bonzini
2021-05-21 15:53       ` Vladimir Sementsov-Ogievskiy
2021-05-21 15:56       ` Vladimir Sementsov-Ogievskiy
2021-05-21 16:47         ` Paolo Bonzini
2021-05-18 10:07 ` [PATCH v2 7/7] block-copy: protect BlockCopyState .method fields Emanuele Giuseppe Esposito
2021-05-21 17:10   ` Vladimir Sementsov-Ogievskiy
2021-05-25 10:18     ` Emanuele Giuseppe Esposito
2021-05-25 11:00       ` Vladimir Sementsov-Ogievskiy
2021-05-26 14:48         ` Paolo Bonzini
2021-05-26 17:18           ` Vladimir Sementsov-Ogievskiy
2021-05-28 10:24             ` Paolo Bonzini
2021-05-28 11:01               ` Paolo Bonzini
2021-05-28 11:52                 ` Vladimir Sementsov-Ogievskiy
2021-05-28 12:44                 ` Vladimir Sementsov-Ogievskiy
2021-05-20 13:47 ` [PATCH v2 0/7] block-copy: protect block-copy internal structures Vladimir Sementsov-Ogievskiy
2021-05-20 14:33   ` Emanuele Giuseppe Esposito
2021-05-27 10:31 ` Stefan Hajnoczi

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