Re: [PATCH V3] block: optimize for small block size IO

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

 



On Wed, Oct 30, 2019 at 06:54:26AM -0700, Christoph Hellwig wrote:
> On Wed, Oct 30, 2019 at 08:21:26AM +0800, Ming Lei wrote:
> > > +		if ((*bio)->bi_vcnt == 1 &&
> > > +		    (*bio)->bi_io_vec[0].bv_len <= PAGE_SIZE) {
> > > +			*nr_segs = 1;
> > > +			return;
> > > +		}
> > >  		split = blk_bio_segment_split(q, *bio, &q->bio_split, nr_segs);
> > >  		break;
> > >  	}
> > 
> > This bio(*bio) may be a fast-cloned bio from somewhere(DM, MD, ...), so the above
> > check can't work sometime.
> 
> Please explain how it doesn't work.  In the worse case it will give us
> a false negastive, that is we don't take the fast path when in theory
> we could, but then again fast cloneѕ bios will have so much overhead
> that it should not matter.

In theory, we shouldn't use fast clone bio's .bi_vcnt, so far it is
zero, in future fast clone bio's bi_vcnt might be used for other purpose.

Also this bio may not a fast cloned bio, but it has been splitted(such
as one 4k bio, and its front 512 byte is splitted out). It depends on
if the remained bio needs to be splitted again. In reality, looks it
won't be possible.

In short, the above way is like a hack, but it should work in reality.

I am fine with that, if comment of this usage is added.


Thanks,
Ming





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM Kernel]     [Linux Filesystem Development]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux