All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Max Reitz <mreitz@redhat.com>, kwolf@redhat.com
Cc: pbonzini@redhat.com, Jeff Cody <jcody@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v12 1/2] mirror: Rewrite mirror_iteration
Date: Mon, 15 Feb 2016 10:19:42 +0800	[thread overview]
Message-ID: <20160215021942.GA9922@ad.usersys.redhat.com> (raw)
In-Reply-To: <56B89006.3040108@redhat.com>

On Mon, 02/08 13:54, Max Reitz wrote:
> On 07.02.2016 13:46, Fam Zheng wrote:
> > On Sat, 02/06 14:24, Max Reitz wrote:
> >> On 05.02.2016 03:00, Fam Zheng wrote:
> >>> The "pnum < nb_sectors" condition in deciding whether to actually copy
> >>> data is unnecessarily strict, and the qiov initialization is
> >>> unnecessarily for bdrv_aio_write_zeroes and bdrv_aio_discard.
> >>>
> >>> Rewrite mirror_iteration to fix both flaws.
> >>>
> >>> The output of iotests 109 is updated because we now report the offset
> >>> and len slightly differently in mirroring progress.
> >>>
> >>> Signed-off-by: Fam Zheng <famz@redhat.com>
> >>> ---
> >>>  block/mirror.c             | 335 +++++++++++++++++++++++++++------------------
> >>>  tests/qemu-iotests/109.out |  80 +++++------
> >>>  trace-events               |   1 -
> >>>  3 files changed, 243 insertions(+), 173 deletions(-)
> >>>
> >>> diff --git a/block/mirror.c b/block/mirror.c
> >>> index 2c0edfa..48cd0b3 100644
> >>> --- a/block/mirror.c
> >>> +++ b/block/mirror.c
> >>
> >> [...]
> >>
> >>> @@ -449,16 +520,16 @@ static void coroutine_fn mirror_run(void *opaque)
> >>>       */
> >>>      bdrv_get_backing_filename(s->target, backing_filename,
> >>>                                sizeof(backing_filename));
> >>> -    if (backing_filename[0] && !s->target->backing) {
> >>> -        ret = bdrv_get_info(s->target, &bdi);
> >>> -        if (ret < 0) {
> >>> -            goto immediate_exit;
> >>> -        }
> >>> -        if (s->granularity < bdi.cluster_size) {
> >>> -            s->buf_size = MAX(s->buf_size, bdi.cluster_size);
> >>> -            s->cow_bitmap = bitmap_new(length);
> >>> -        }
> >>> +    if (!bdrv_get_info(s->target, &bdi) && bdi.cluster_size) {
> >>
> >> This should be bdi.has_cluster_size...
> > 
> > has_cluster_size is a member of ImageInfo not BlockDriverInfo, and is derived
> > from (bdi.cluster_size != 0).
> 
> You're right, my bad.
> 
> >>> +        target_cluster_size = bdi.cluster_size;
> >>
> >> ...and maybe we want an explicit minimum of BDRV_SECTOR_SIZE here; but I
> >> guess this is already assumed all over the block layer, so it may be
> >> fine without.
> > 
> > Okay, it doesn't hurt to add an assert here.
> 
> I'd be happy to take the patch without, too (although I wouldn't decline
> a follow-up adding an assertion).
> 
> Reviewed-by: Max Reitz <mreitz@redhat.com>

Thanks! Shall we merge this now?

Fam

  reply	other threads:[~2016-02-15  2:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05  2:00 [Qemu-devel] [PATCH v12 0/2] mirror: Improve zero write and discard Fam Zheng
2016-02-05  2:00 ` [Qemu-devel] [PATCH v12 1/2] mirror: Rewrite mirror_iteration Fam Zheng
2016-02-06 13:24   ` Max Reitz
2016-02-07 12:46     ` Fam Zheng
2016-02-08 12:54       ` Max Reitz
2016-02-15  2:19         ` Fam Zheng [this message]
2016-02-15  3:49           ` Jeff Cody
2016-02-15  4:31             ` Fam Zheng
2016-02-05  2:00 ` [Qemu-devel] [PATCH v12 2/2] mirror: Add mirror_wait_for_io Fam Zheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160215021942.GA9922@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.