Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2500910imu; Mon, 19 Nov 2018 01:21:59 -0800 (PST) X-Google-Smtp-Source: AJdET5eSJoCD11tWV4Y3AyyqkI+IZ+G6EFGv0Xn5Y9/TkSx5pk2iliOsQ6vog/Az4YS7xgfk4VWo X-Received: by 2002:a17:902:f24:: with SMTP id 33-v6mr22185589ply.228.1542619318984; Mon, 19 Nov 2018 01:21:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542619318; cv=none; d=google.com; s=arc-20160816; b=WpVK3HlvJlbRtCu8K8W2p0kzU9iVkp02CGvywWAhI5Lsr6Q6jaYA16nyBjD9XLs7+f s7pxdp0fl1QT3uagyBkW0buk3gH8BB6tyLeID+jxK/5EjOAjpWOGYn9nFV+Y5/GzvAxJ U69XvElYVRJTFAQY4NheFJFhD7FwWVCXgml/yiyWZWpEe2rW23Nkw8rBpm9+Fs035wJI FV8LreQeoBGn/MAvGIUxlMrXFCg7A8XJVVLSEMHiN5aTqPKYpSKPbD5/HRxLIwkUSVCv FyqqgYhW96YUAzqB4cHWJz01BRO5b0OSMSxa8/ssolLqRRLrMOBNtdHQzsy87SWN1IjP eGYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=h4CrsYQRhIiYLk2id2cnKoSe82UmBni1u0UA9FFWX5A=; b=QbHJq5D7X8qiA88AC7F/O0ub2jilNLgo/dXnpCi6y+hDBvbEu9KeWu6UweTw4djKgB 02oIzIUi7wlw0/f1QGIk2Y/5+l9WNzBRo6JT9ejkb6CV1IH7uCqb+b7/6Iq3zxiBEm5K 400XYjQ0Ef3hgm27vEELrw5iFy2Dkt7c64oTSBjxCpQmi93MxFmDjWX8NdZDDipOeJrL teLE3agsDnK7tORAPU03SXX471Q5zzsQuFT8DG+o8Ej6OEkwnNlEXOl2Y8NPBZ9PhVTf g/1V8MV2uay5RUCd4sFx2lpQLBNzoEeHrQudRez36g3rxNAEktJ/J1IMK7pIOMJNdvpF jSUw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j195si150662pfd.165.2018.11.19.01.21.43; Mon, 19 Nov 2018 01:21:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727447AbeKSToI (ORCPT + 99 others); Mon, 19 Nov 2018 14:44:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57646 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726988AbeKSToH (ORCPT ); Mon, 19 Nov 2018 14:44:07 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CDC13308339D; Mon, 19 Nov 2018 09:21:04 +0000 (UTC) Received: from ming.t460p (ovpn-8-26.pek2.redhat.com [10.72.8.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8333F5C70B; Mon, 19 Nov 2018 09:20:45 +0000 (UTC) Date: Mon, 19 Nov 2018 17:20:41 +0800 From: Ming Lei To: Christoph Hellwig Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Dave Chinner , Kent Overstreet , Mike Snitzer , dm-devel@redhat.com, Alexander Viro , linux-fsdevel@vger.kernel.org, Shaohua Li , linux-raid@vger.kernel.org, linux-erofs@lists.ozlabs.org, David Sterba , linux-btrfs@vger.kernel.org, "Darrick J . Wong" , linux-xfs@vger.kernel.org, Gao Xiang , Theodore Ts'o , linux-ext4@vger.kernel.org, Coly Li , linux-bcache@vger.kernel.org, Boaz Harrosh , Bob Peterson , cluster-devel@redhat.com Subject: Re: [PATCH V10 18/19] block: kill QUEUE_FLAG_NO_SG_MERGE Message-ID: <20181119092040.GP16736@ming.t460p> References: <20181115085306.9910-1-ming.lei@redhat.com> <20181115085306.9910-19-ming.lei@redhat.com> <20181116135803.GN3165@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181116135803.GN3165@lst.de> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 19 Nov 2018 09:21:05 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > Cc: Kent Overstreet > > Cc: Mike Snitzer > > Cc: dm-devel@redhat.com > > Cc: Alexander Viro > > Cc: linux-fsdevel@vger.kernel.org > > Cc: Shaohua Li > > Cc: linux-raid@vger.kernel.org > > Cc: linux-erofs@lists.ozlabs.org > > Cc: David Sterba > > Cc: linux-btrfs@vger.kernel.org > > Cc: Darrick J. Wong > > Cc: linux-xfs@vger.kernel.org > > Cc: Gao Xiang > > Cc: Christoph Hellwig > > Cc: Theodore Ts'o > > Cc: linux-ext4@vger.kernel.org > > Cc: Coly Li > > Cc: linux-bcache@vger.kernel.org > > Cc: Boaz Harrosh > > Cc: Bob Peterson > > Cc: cluster-devel@redhat.com > > Signed-off-by: Ming Lei > > --- > > 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