Re: [PATCH v4 11/13] mirror: Skip writing zeroes when target is already zero

2025-05-14 Thread Sunny Zhu
On Fri, 9 May 2025 15:40:28 -0500, Eric Blake wrote: > @@ -847,8 +887,10 @@ static int coroutine_fn GRAPH_UNLOCKED > mirror_dirty_init(MirrorBlockJob *s) > bool punch_holes = > target_bs->detect_zeroes == BLOCKDEV_DETECT_ZEROES_OPTIONS_UNMAP && > bdrv_can_write_zeroes_with_u

Re: [PATCH v4 10/13] mirror: Skip pre-zeroing destination if it is already zero

2025-05-13 Thread Sunny Zhu
Rebase later in series, revise logic for pre-zeroing [Sunny], add > in python filter > --- > block/mirror.c| 24 > tests/qemu-iotests/194| 6 -- > tests/qemu-iotests/194.out| 4 ++-- > tests/qemu-iotests/iotests.py | 12 +++- > 4 files changed, 33 insertions(+), 13 deletions(-) Reviewed-by: Sunny Zhu

Re: [PATCH v4 09/13] mirror: Drop redundant zero_target parameter

2025-05-13 Thread Sunny Zhu
othread.c | 2 +- > 4 files changed, 11 insertions(+), 22 deletions(-) Reviewed-by: Sunny Zhu

Re: [PATCH v4 08/13] mirror: Allow QMP override to declare target already zero

2025-05-13 Thread Sunny Zhu
t (in many aspects simpler, but now > catering to "detect-zeroes":"unmap") so Acked-by on QMP kept, but > Reviewed-by dropped. > --- > qapi/block-core.json | 8 +++- > include/block/block_int-global-state.h | 3 ++- > block/mirror.c | 27 ++ > blockdev.c | 18 ++--- > tests/unit/test-block-iothread.c | 2 +- > 5 files changed, 44 insertions(+), 14 deletions(-) Reviewed-by: Sunny Zhu

Re: [PATCH v4 08/13] mirror: Allow QMP override to declare target already zero

2025-05-12 Thread Sunny Zhu
On Fri, May 09, 2025 at 03:40:25PM -0500, Eric Blake wrote: > QEMU has an optimization for a just-created drive-mirror destination > that is not possible for blockdev-mirror (which can't create the > destination) - any time we know the destination starts life as all > zeroes, we can skip a pre-zero

Re: [PATCH v4 07/13] mirror: Pass full sync mode rather than bool to internals

2025-05-12 Thread Sunny Zhu
> > --- > > v4: new patch > --- > block/mirror.c | 24 ---- > 1 file changed, 12 insertions(+), 12 deletions(-) Reviewed-by: Sunny Zhu

Re [PATCH v3 08/11] mirror: Skip writing zeroes when target is already zero

2025-05-01 Thread Sunny Zhu
On Thu, 1 May 2025 12:58:42 -0500, Eric wrote: > On Thu, May 01, 2025 at 12:38:30AM +0800, Sunny Zhu wrote: > > on Thu 24 Apr 2025 19:52:08 -0500, Eric wrote: > > > if (s->zero_target) { > > > +int64_t bitmap_length = DIV_ROUND_UP(s->b

Re: [PATCH v3 07/11] mirror: Skip pre-zeroing destination if it is already zero

2025-05-01 Thread Sunny Zhu
On Thu, 1 May 2025 12:33:14 -0500, Eric wrote: > > > + * If the destination already reads as zero, and we are not > > > + * requested to punch holes into existing zeroes, then we can > > > + * skip pre-zeroing the destination. > > > + */ > > > +if (ret > 0 &&

Re [PATCH v3 08/11] mirror: Skip writing zeroes when target is already zero

2025-04-30 Thread Sunny Zhu
on Thu 24 Apr 2025 19:52:08 -0500, Eric wrote: > if (s->zero_target) { > +int64_t bitmap_length = DIV_ROUND_UP(s->bdev_length, s->granularity); > + > offset = 0; > bdrv_graph_co_rdlock(); > ret = bdrv_co_is_all_zeroes(target_bs); > @@ -856,6 +898,7 @@ static

Re: [PATCH v3 07/11] mirror: Skip pre-zeroing destination if it is already zero

2025-04-30 Thread Sunny Zhu
> When doing a sync=full mirroring, QMP drive-mirror requests full > zeroing if it did not just create the destination, and blockdev-mirror > requests full zeroing unconditionally. This is because during a full > sync, we must ensure that the portions of the disk that are not > otherwise touched b

Re: [PATCH v2 08/11] mirror: Skip writing zeroes when target is already zero

2025-04-23 Thread Sunny Zhu
on Thu, 17 Apr 2025 13:39:13 -0500, Eric Blake wrote: > When mirroring, the goal is to ensure that the destination reads the > same as the source; this goal is met whether the destination is sparse > or fully-allocated. However, if the destination cannot efficiently > write zeroes, then any time t

[PATCH v2] block: Remove unused callback function *bdrv_aio_pdiscard

2025-04-21 Thread Sunny Zhu
d. If someone needs to implement bdrv_aio_pdiscard, a coroutine-based version would be straightforward to implement. Signed-off-by: Sunny Zhu --- block/io.c | 22 +++--- include/block/block_int-common.h | 4 2 files changed, 3 insertions(+), 23 deletions(-)

Re: [PATCH] block: change type of bytes from int to int64_t for *bdrv_aio_pdiscard

2025-04-21 Thread Sunny Zhu
Eric Blake wrote: >On Mon, Apr 21, 2025 at 12:19:14AM +0800, Sunny Zhu wrote: >> Keep it consistent with *bdrv_co_pdiscard. >> >> Currently, there is no BlockDriver implemented the bdrv_aio_pdiscard() >> function, >> so we don’t need to make any adaptations e

[PATCH] block: change type of bytes from int to int64_t for *bdrv_aio_pdiscard

2025-04-20 Thread Sunny Zhu
Keep it consistent with *bdrv_co_pdiscard. Currently, there is no BlockDriver implemented the bdrv_aio_pdiscard() function, so we don’t need to make any adaptations either. Signed-off-by: Sunny Zhu --- include/block/block_int-common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff