Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2471611imu; Mon, 19 Nov 2018 00:46:51 -0800 (PST) X-Google-Smtp-Source: AJdET5fyfwh+HPidtjDOfQH0K9fXUmDPcQrQeBa9pBI2lOULRdKn/hTRU0RUrW0pEOv4rSsHguw0 X-Received: by 2002:a63:4745:: with SMTP id w5mr19777914pgk.377.1542617211826; Mon, 19 Nov 2018 00:46:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542617211; cv=none; d=google.com; s=arc-20160816; b=lwbTF4kZu025g4BspwPJSJXYzP/h1EduVPKJMnFUlNe0GkjhkTAK2+Diq6dy1GyyEC ps0rDPF8TdROUD6jKyK4mURyz7ai2VTpxK7Brb1V39/sUstAkvL4xiz59jh7ZK1ppzWA mkmnXA4xTo4QfAZor+axCKNUohGOrZxGcA6OpjiunCVbHGt5XXrzZD6TuJDbFDgdbcMe Ap6NZuoD15FUmbTAXw5nC/EQF4FVgeF4i2ltISJZnV38rYSYACqW9rKkG7df2Qd8CvbD kMh+f+xkw2Zqa70YM4kmB8JIIMYTmD51sTOXliCSDmEiMJPOpfnShiBnMjaRhgsJrU1V 1f6g== 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=b8bdR2eyflR7m9RTbYG8Svc5sXhXU73gxsCnx+wbBs8=; b=gsP/f+F52hM0toa6sS0mBIlFxaayi+47RpP0v5ohQvRU51tcWRjeuNrzSoilm74MOY UBupuxKdtopbYrafFyhkrMSO4ExMGG+bp+L1jAtQUAWnEK2XKYwmD9+BGQWY/Pk3+JMV gI6Kp9v90S/9E0HaavLezD5cVNFgZZBxUO98S7FHkmzEU+f5qmNX0htsVBjk2QJh8PxC hB0afTgl3gFzQrQnXEbbS1ik0g0v2icYVzd+f3Dx5VaAXmME/CwB+bdzKiTR9OfbKl2B OZIjbl5gcIpeyySsW5s78cuV12WgsnzW/4Gxbr7yRt1Nw1/8mHdc26Ow0pF7Jt80kOfs wXyA== 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 j20si38722241pgh.224.2018.11.19.00.46.36; Mon, 19 Nov 2018 00:46:51 -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 S1727274AbeKSTI5 (ORCPT + 99 others); Mon, 19 Nov 2018 14:08:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35034 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbeKSTI4 (ORCPT ); Mon, 19 Nov 2018 14:08:56 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9A87C308FC4E; Mon, 19 Nov 2018 08:45:58 +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 8F9CA6090A; Mon, 19 Nov 2018 08:45:27 +0000 (UTC) Date: Mon, 19 Nov 2018 16:45:23 +0800 From: Ming Lei To: Omar Sandoval 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 , Christoph Hellwig , 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 14/19] block: enable multipage bvecs Message-ID: <20181119084522.GK16736@ming.t460p> References: <20181115085306.9910-1-ming.lei@redhat.com> <20181115085306.9910-15-ming.lei@redhat.com> <20181116015627.GI23828@vader> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181116015627.GI23828@vader> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 19 Nov 2018 08:45:59 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 15, 2018 at 05:56:27PM -0800, Omar Sandoval wrote: > On Thu, Nov 15, 2018 at 04:53:01PM +0800, Ming Lei wrote: > > This patch pulls the trigger for multi-page bvecs. > > > > Now any request queue which supports queue cluster will see multi-page > > bvecs. > > > > 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/bio.c | 24 ++++++++++++++++++------ > > 1 file changed, 18 insertions(+), 6 deletions(-) > > > > diff --git a/block/bio.c b/block/bio.c > > index 6486722d4d4b..ed6df6f8e63d 100644 > > --- a/block/bio.c > > +++ b/block/bio.c > > This comment above __bio_try_merge_page() doesn't make sense after this > change: > > This is a > a useful optimisation for file systems with a block size smaller than the > page size. > > Can you please get rid of it in this patch? I understand __bio_try_merge_page() still works for original cases, so looks the optimization for sub-pagesize is still there too, isn't it? > > > @@ -767,12 +767,24 @@ bool __bio_try_merge_page(struct bio *bio, struct page *page, > > > > if (bio->bi_vcnt > 0) { > > struct bio_vec *bv = &bio->bi_io_vec[bio->bi_vcnt - 1]; > > - > > - if (page == bv->bv_page && off == bv->bv_offset + bv->bv_len) { > > - bv->bv_len += len; > > - bio->bi_iter.bi_size += len; > > - return true; > > - } > > + struct request_queue *q = NULL; > > + > > + if (page == bv->bv_page && off == (bv->bv_offset + bv->bv_len) > > + && (off + len) <= PAGE_SIZE) > > + goto merge; > > The parentheses around (bv->bv_offset + bv->bv_len) and (off + len) are > unnecessary noise. > > What's the point of the new (off + len) <= PAGE_SIZE check? Yeah, I don't know why I did it, :-(, the check is absolutely always true. > > > + > > + if (bio->bi_disk) > > + q = bio->bi_disk->queue; > > + > > + /* disable multi-page bvec too if cluster isn't enabled */ > > + if (!q || !blk_queue_cluster(q) || > > + ((page_to_phys(bv->bv_page) + bv->bv_offset + bv->bv_len) != > > + (page_to_phys(page) + off))) > > More unnecessary parentheses here. OK. Thanks, Ming