Re: [PATCH v2 4/7] block-copy: add a CoMutex to the BlockCopyTask list

2021-05-27 Thread Stefan Hajnoczi
On Tue, May 18, 2021 at 12:07:54PM +0200, Emanuele Giuseppe Esposito wrote: > -static BlockCopyTask *find_conflicting_task(BlockCopyState *s, > -int64_t offset, int64_t bytes) > +/* Called with lock held */ s/lock/tasks_lock/ signature.asc Description:

Re: [PATCH v2 4/7] block-copy: add a CoMutex to the BlockCopyTask list

2021-05-26 Thread Vladimir Sementsov-Ogievskiy
26.05.2021 17:58, Paolo Bonzini wrote: On 25/05/21 12:25, Vladimir Sementsov-Ogievskiy wrote: Next, even if we take bitmaps lock in bdrv_dirty_bitmap_next_dirty_area() or around it, it doesn't bring thread-safety to block_copy_task_create(): The simplest solution here seems to protect bdrv_di

Re: [PATCH v2 4/7] block-copy: add a CoMutex to the BlockCopyTask list

2021-05-26 Thread Paolo Bonzini
On 25/05/21 12:25, Vladimir Sementsov-Ogievskiy wrote: Next, even if we take bitmaps lock in bdrv_dirty_bitmap_next_dirty_area() or around it, it doesn't bring thread-safety to block_copy_task_create(): The simplest solution here seems to protect bdrv_dirty_bitmap_next_dirty_area and also bdr

Re: [PATCH v2 4/7] block-copy: add a CoMutex to the BlockCopyTask list

2021-05-25 Thread Vladimir Sementsov-Ogievskiy
25.05.2021 13:07, Emanuele Giuseppe Esposito wrote: On 20/05/2021 17:19, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: Because the list of tasks is only modified by coroutine functions, add a CoMutex in order to protect them. Use the same mutex to pr

Re: [PATCH v2 4/7] block-copy: add a CoMutex to the BlockCopyTask list

2021-05-25 Thread Emanuele Giuseppe Esposito
On 20/05/2021 17:19, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: Because the list of tasks is only modified by coroutine functions, add a CoMutex in order to protect them. Use the same mutex to protect also BlockCopyState in_flight_bytes field to a

Re: [PATCH v2 4/7] block-copy: add a CoMutex to the BlockCopyTask list

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: Because the list of tasks is only modified by coroutine functions, add a CoMutex in order to protect them. Use the same mutex to protect also BlockCopyState in_flight_bytes field to avoid adding additional syncronization primitives. Signed-off