qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-block] [PATCH] mirror: Improve zero-write and dis


From: Fam Zheng
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] mirror: Improve zero-write and discard with fragmented image
Date: Mon, 9 Nov 2015 10:12:54 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, 11/06 19:36, Max Reitz wrote:
> > +    next_sector = sector_num;
> > +    next_chunk = sector_num / sectors_per_chunk;
> 
> @next_sector and @next_chunk set here...
> 
> >      hbitmap_next_sector = s->sector_num;
> > -    sector_num = s->sector_num;
> > -    sectors_per_chunk = s->granularity >> BDRV_SECTOR_BITS;
> > -    end = s->bdev_length / BDRV_SECTOR_SIZE;
> >  
> >      /* Extend the QEMUIOVector to include all adjacent blocks that will
> >       * be copied in this operation.
> > @@ -198,14 +191,6 @@ static uint64_t coroutine_fn 
> > mirror_iteration(MirrorBlockJob *s)
> >      next_sector = sector_num;
> >      next_chunk = sector_num / sectors_per_chunk;
> 
> ...and here already. So the above seems superfluous, considering that
> they are not read in between.
> 
> (If you keep hbitmap_next_sector = s->sector_num; above the sector_num =
> ... block, that may reduce conflicts further)

Indeed, thanks for noticing this.

> > +    case MIRROR_METHOD_DISCARD:
> > +        return mirror_do_zero_or_discard(s, sector_num,
> > +                                         contiguous_sectors,
> > +                                         false);
> 
> s/false/true/?

Yes, thanks.

Fam




reply via email to

[Prev in Thread] Current Thread [Next in Thread]