Re: [PATCH v2 5/5] md: fast clone bio in bio_clone_mddev()

From: Shaohua Li
Date: Wed Feb 15 2017 - 18:56:40 EST


On Wed, Feb 15, 2017 at 11:20:25AM -0800, Shaohua Li wrote:
> On Tue, Feb 14, 2017 at 08:01:09AM -0800, Christoph Hellwig wrote:
> > On Tue, Feb 14, 2017 at 11:29:03PM +0800, Ming Lei wrote:
> > > Firstly bio_clone_mddev() is used in raid normal I/O and isn't
> > > in resync I/O path.
> > >
> > > Secondly all the direct access to bvec table in raid happens on
> > > resync I/O except for write behind of raid1, in which we still
> > > use bio_clone() for allocating new bvec table.
> > >
> > > So this patch replaces bio_clone() with bio_clone_fast()
> > > in bio_clone_mddev().
> > >
> > > Also kill bio_clone_mddev() and call bio_clone_fast() directly, as
> > > suggested by Christoph Hellwig.
> > >
> > > Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx>
> >
> > Looks fine,
> >
> > Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> >
> > Btw, can you also tack on another patch to kill bio_alloc_mddev
> > to be consistent?
>
> I'll take care of this

Hmm, bio_alloc_mddev is a little different, it could be called without the
bio_set. We can only guarantee the bio_set is valid for bio for md personality
not for metadata. Fully fixing the bio_set issue will need rework mddev struct
allocation, don't think it's worthy doing. So below is one removing the export
of the wrap.