Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-27 Thread Paolo Bonzini
Il gio 27 mag 2021, 14:07 Stefan Hajnoczi ha scritto: > On Tue, May 18, 2021 at 12:07:51PM +0200, Emanuele Giuseppe Esposito wrote: > > } else { > > /* > > * We enable copy-range, but keep small copy_size, until first > > * successful copy_range (look at block_co

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-27 Thread Stefan Hajnoczi
On Tue, May 18, 2021 at 12:07:51PM +0200, Emanuele Giuseppe Esposito wrote: > } else { > /* > * We enable copy-range, but keep small copy_size, until first > * successful copy_range (look at block_copy_do_copy). > */ Is this comment still correct? It app

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-21 Thread Vladimir Sementsov-Ogievskiy
21.05.2021 18:10, Paolo Bonzini wrote: Stats don't say everything.  Not having something like this:     s->copy_size =     MIN(MAX(s->cluster_size, BLOCK_COPY_MAX_COPY_RANGE),     QEMU_ALIGN_DOWN(block_copy_max_transfer(s->source,  

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-21 Thread Paolo Bonzini
On 21/05/21 17:48, Vladimir Sementsov-Ogievskiy wrote: I keep it thinking about further moving qemu-img convert to block-copy. But I don't even have a plan when to start this work. So, if we want to do something around copy_range here to prepare for thread-safety, let's just drop it for now as

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-21 Thread Vladimir Sementsov-Ogievskiy
21.05.2021 18:10, Paolo Bonzini wrote: On 20/05/21 16:42, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for the possible metho

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-21 Thread Paolo Bonzini
On 20/05/21 16:42, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for the possible methods of copying data from one BlockDriverS

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
20.05.2021 18:06, Emanuele Giuseppe Esposito wrote: On 20/05/2021 16:42, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for t

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-20 Thread Emanuele Giuseppe Esposito
On 20/05/2021 16:42, Vladimir Sementsov-Ogievskiy wrote: 18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for the possible methods of copying data from one BlockDr

Re: [PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-20 Thread Vladimir Sementsov-Ogievskiy
18.05.2021 13:07, Emanuele Giuseppe Esposito wrote: From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for the possible methods of copying data from one BlockDriverState to the other. Honestly, for me 4-state state-mach

[PATCH v2 1/7] block-copy: streamline choice of copy_range vs. read/write

2021-05-18 Thread Emanuele Giuseppe Esposito
From: Paolo Bonzini Put the logic to determine the copy size in a separate function, so that there is a simple state machine for the possible methods of copying data from one BlockDriverState to the other. While at it, store the common computation of block_copy_max_transfer into a new field of B