[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181119092040.GP16736@ming.t460p>
Date: Mon, 19 Nov 2018 17:20:41 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Christoph Hellwig <hch@....de>
Cc: Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Dave Chinner <dchinner@...hat.com>,
Kent Overstreet <kent.overstreet@...il.com>,
Mike Snitzer <snitzer@...hat.com>, dm-devel@...hat.com,
Alexander Viro <viro@...iv.linux.org.uk>,
linux-fsdevel@...r.kernel.org, Shaohua Li <shli@...nel.org>,
linux-raid@...r.kernel.org, linux-erofs@...ts.ozlabs.org,
David Sterba <dsterba@...e.com>, linux-btrfs@...r.kernel.org,
"Darrick J . Wong" <darrick.wong@...cle.com>,
linux-xfs@...r.kernel.org, Gao Xiang <gaoxiang25@...wei.com>,
Theodore Ts'o <tytso@....edu>, linux-ext4@...r.kernel.org,
Coly Li <colyli@...e.de>, linux-bcache@...r.kernel.org,
Boaz Harrosh <ooo@...ctrozaur.com>,
Bob Peterson <rpeterso@...hat.com>, cluster-devel@...hat.com
Subject: Re: [PATCH V10 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE
On Fri, Nov 16, 2018 at 02:58:03PM +0100, Christoph Hellwig wrote:
> On Thu, Nov 15, 2018 at 04:53:05PM +0800, Ming Lei wrote:
> > Since bdced438acd83ad83a6c ("block: setup bi_phys_segments after splitting"),
> > physical segment number is mainly figured out in blk_queue_split() for
> > fast path, and the flag of BIO_SEG_VALID is set there too.
> >
> > Now only blk_recount_segments() and blk_recalc_rq_segments() use this
> > flag.
> >
> > Basically blk_recount_segments() is bypassed in fast path given BIO_SEG_VALID
> > is set in blk_queue_split().
> >
> > For another user of blk_recalc_rq_segments():
> >
> > - run in partial completion branch of blk_update_request, which is an unusual case
> >
> > - run in blk_cloned_rq_check_limits(), still not a big problem if the flag is killed
> > since dm-rq is the only user.
> >
> > Multi-page bvec is enabled now, QUEUE_FLAG_NO_SG_MERGE doesn't make sense any more.
> >
> > Cc: Dave Chinner <dchinner@...hat.com>
> > Cc: Kent Overstreet <kent.overstreet@...il.com>
> > Cc: Mike Snitzer <snitzer@...hat.com>
> > Cc: dm-devel@...hat.com
> > Cc: Alexander Viro <viro@...iv.linux.org.uk>
> > Cc: linux-fsdevel@...r.kernel.org
> > Cc: Shaohua Li <shli@...nel.org>
> > Cc: linux-raid@...r.kernel.org
> > Cc: linux-erofs@...ts.ozlabs.org
> > Cc: David Sterba <dsterba@...e.com>
> > Cc: linux-btrfs@...r.kernel.org
> > Cc: Darrick J. Wong <darrick.wong@...cle.com>
> > Cc: linux-xfs@...r.kernel.org
> > Cc: Gao Xiang <gaoxiang25@...wei.com>
> > Cc: Christoph Hellwig <hch@....de>
> > Cc: Theodore Ts'o <tytso@....edu>
> > Cc: linux-ext4@...r.kernel.org
> > Cc: Coly Li <colyli@...e.de>
> > Cc: linux-bcache@...r.kernel.org
> > Cc: Boaz Harrosh <ooo@...ctrozaur.com>
> > Cc: Bob Peterson <rpeterso@...hat.com>
> > Cc: cluster-devel@...hat.com
> > Signed-off-by: Ming Lei <ming.lei@...hat.com>
> > ---
> > block/blk-merge.c | 31 ++++++-------------------------
> > block/blk-mq-debugfs.c | 1 -
> > block/blk-mq.c | 3 ---
> > drivers/md/dm-table.c | 13 -------------
> > include/linux/blkdev.h | 1 -
> > 5 files changed, 6 insertions(+), 43 deletions(-)
> >
> > diff --git a/block/blk-merge.c b/block/blk-merge.c
> > index 153a659fde74..06be298be332 100644
> > --- a/block/blk-merge.c
> > +++ b/block/blk-merge.c
> > @@ -351,8 +351,7 @@ void blk_queue_split(struct request_queue *q, struct bio **bio)
> > EXPORT_SYMBOL(blk_queue_split);
> >
> > static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
> > - struct bio *bio,
> > - bool no_sg_merge)
> > + struct bio *bio)
> > {
> > struct bio_vec bv, bvprv = { NULL };
> > int cluster, prev = 0;
> > @@ -379,13 +378,6 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
> > nr_phys_segs = 0;
> > for_each_bio(bio) {
> > bio_for_each_bvec(bv, bio, iter) {
> > - /*
> > - * If SG merging is disabled, each bio vector is
> > - * a segment
> > - */
> > - if (no_sg_merge)
> > - goto new_segment;
> > -
> > if (prev && cluster) {
> > if (seg_size + bv.bv_len
> > > queue_max_segment_size(q))
> > @@ -420,27 +412,16 @@ static unsigned int __blk_recalc_rq_segments(struct request_queue *q,
> >
> > void blk_recalc_rq_segments(struct request *rq)
> > {
> > - bool no_sg_merge = !!test_bit(QUEUE_FLAG_NO_SG_MERGE,
> > - &rq->q->queue_flags);
> > -
> > - rq->nr_phys_segments = __blk_recalc_rq_segments(rq->q, rq->bio,
> > - no_sg_merge);
> > + rq->nr_phys_segments = __blk_recalc_rq_segments(rq->q, rq->bio);
>
> Can we rename __blk_recalc_rq_segments to blk_recalc_rq_segments
> can kill the old blk_recalc_rq_segments now?
Sure.
Thanks,
Ming
Powered by blists - more mailing lists