Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1508519imu; Tue, 20 Nov 2018 19:54:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/WSPhfKt8QwmPiac2vLshUA1zL9YTBoGUbZgk86gpcgOTLbMo0zzkIYNvPEFUIr6eId8AYr X-Received: by 2002:a17:902:622:: with SMTP id 31-v6mr5126216plg.310.1542772484099; Tue, 20 Nov 2018 19:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542772484; cv=none; d=google.com; s=arc-20160816; b=Sop2gt9pjKlAvm6n2YCgkoKomao2anuQZrHBw5EwQKPKgmfzhyEay6eK3HrBWQiZUY l3FDgWspIP6Jp+rPbraYUlurbb3lvZ0e8LFws598oXYFP7WEqBEQ3lHRw6L9Mm4bUD72 dCxpoPwmtldLtbAQOAAt8JYbdMVElf5gzbRjNKhfVkKEof3SIEkIS7Q5W4f//auYvi3y e4ptEPSi1/pyZVsDywRBLXSr+hOTE8tPp0+PWS36L/h/FAWeTkcz3yGjkz3m9xk0oHTZ qN+SvSW6TirnX5xuGhhmNT+8HJXNN456RIVkRQiFVyBUun5XMyvDwr8MQJSKpeUTCYSo L4zQ== 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=+b8FCIimET3KvVbZlyUfUj0O2J0+4NlK6BhcshQxTmA=; b=SbRiOFfuH4zFmqFdjLZU1QTm8uLu7R4R/Ft6PxxPQ2AJcgQthSzwWcMbmY+vnM1BjF LKAdJXgY6Fjz3hU/LX6O7n2LAUTZuBuwGcDIHk0VOhqjc8VW7lH/9C5x1yvI0cbZrQSa 4zOqhYxwHosE350y3yqSuYDTvUdRv1hq0zgweFCMp/kVisEIeFjWrNfr7+IClE3vITp7 Ox/AH2a9RGXdTEuZI5oBRSyWOc3lALPrvyW1CvQnDIgE7HlOFXvOfkyGv5E/gPvIOC2B VfdNpSbRSaHaZXorSx/9kJeiTvEmWzPFqfr5bdCKDvWTJyZBP/A/QSdupJ02Wma1BxIB 0+4g== 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 g4si6712993pfm.85.2018.11.20.19.54.29; Tue, 20 Nov 2018 19:54:44 -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 S1727164AbeKUORV (ORCPT + 99 others); Wed, 21 Nov 2018 09:17:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37070 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726195AbeKUORV (ORCPT ); Wed, 21 Nov 2018 09:17:21 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 815D730820D3; Wed, 21 Nov 2018 03:44:44 +0000 (UTC) Received: from ming.t460p (ovpn-8-21.pek2.redhat.com [10.72.8.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0D4D19C7F; Wed, 21 Nov 2018 03:44:20 +0000 (UTC) Date: Wed, 21 Nov 2018 11:44:16 +0800 From: Ming Lei To: Sagi Grimberg Cc: Christoph Hellwig , 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 09/19] block: introduce bio_bvecs() Message-ID: <20181121034415.GA8408@ming.t460p> References: <20181115085306.9910-1-ming.lei@redhat.com> <20181115085306.9910-10-ming.lei@redhat.com> <20181116134541.GH3165@lst.de> <002fe56b-25e4-573e-c09b-bb12c3e8d25a@grimberg.me> <20181120161651.GB2629@lst.de> <53526aae-fb9b-ee38-0a01-e5899e2d4e4d@grimberg.me> <20181121005902.GA31748@ming.t460p> <2d9bee7a-f010-dcf4-1184-094101058584@grimberg.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2d9bee7a-f010-dcf4-1184-094101058584@grimberg.me> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 21 Nov 2018 03:44:45 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 20, 2018 at 07:20:45PM -0800, Sagi Grimberg wrote: > > > Not sure I understand the 'blocking' problem in this case. > > > > We can build a bvec table from this req, and send them all > > in send(), > > I would like to avoid growing bvec tables and keep everything > preallocated. Plus, a bvec_iter operates on a bvec which means > we'll need a table there as well... Not liking it so far... In case of bios in one request, we can't know how many bvecs there are except for calling rq_bvecs(), so it may not be suitable to preallocate the table. If you have to send the IO request in one send(), runtime allocation may be inevitable. If you don't require to send the IO request in one send(), you may send one bio in one time, and just uses the bio's bvec table directly, such as the single bio case in lo_rw_aio(). > > > can this way avoid your blocking issue? You may see this > > example in branch 'rq->bio != rq->biotail' of lo_rw_aio(). > > This is exactly an example of not ignoring the bios... Yeah, that is the most common example, given merge is enabled in most of cases. If the driver or device doesn't care merge, you can disable it and always get single bio request, then the bio's bvec table can be reused for send(). > > > If this way is what you need, I think you are right, even we may > > introduce the following helpers: > > > > rq_for_each_bvec() > > rq_bvecs() > > I'm not sure how this helps me either. Unless we can set a bvec_iter to > span bvecs or have an abstract bio crossing when we re-initialize the > bvec_iter I don't see how I can ignore bios completely... rq_for_each_bvec() will iterate over all bvecs from all bios, so you needn't to see any bio in this req. rq_bvecs() will return how many bvecs there are in this request(cover all bios in this req) > > > So looks nvme-tcp host driver might be the 2nd driver which benefits > > from multi-page bvec directly. > > > > The multi-page bvec V11 has passed my tests and addressed almost > > all the comments during review on V10. I removed bio_vecs() in V11, > > but it won't be big deal, we can introduce them anytime when there > > is the requirement. > > multipage-bvecs and nvme-tcp are going to conflict, so it would be good > to coordinate on this. I think that nvme-tcp host needs some adjustments > as setting a bvec_iter. I'm under the impression that the change is rather > small and self-contained, but I'm not sure I have the full > picture here. I guess I may not get your exact requirement on block io iterator from nvme-tcp too, :-( thanks, Ming