Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1815279imu; Wed, 21 Nov 2018 02:20:58 -0800 (PST) X-Google-Smtp-Source: AJdET5cyE3VVMCsd7iOoRveK+RPCduh2XNwx9bJFxHR28LNKW1AJcp6PqC6TXJCovmvR8G4kX1b9 X-Received: by 2002:a62:b2c3:: with SMTP id z64mr6108233pfl.120.1542795658105; Wed, 21 Nov 2018 02:20:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542795658; cv=none; d=google.com; s=arc-20160816; b=lfqSmxxfgo9j+Z33gsCYhvfOPbPdMMVllNrQ49qzUzn580Z+sUnZCrluevlD2w+pcL Kaxd2ZdONEuQTtK/FFhMzZ1qzRaSLSPoPqFtPaHXmKtdHtzg4E0vEwL8b/h6jUWkYt9X ciRXftRUg9BJdqpcSGppDmGlrPsaNKdTiSC0hRnSn1ofs20kMIoQy3Ioo+PHQYdg3IA3 5cP6IW4zjxUqapuhmdStJI0DjHiXN5C8jm1CndPStwYHdKPDXUti2nhPM1ferBcLACk7 AADeZ7jy5pZ+6qTK0WXaphUrfty1lNXURKU5gXKQgUXuxvpsIABz6Vu6PCQtcgq4Fs0X S4kg== 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=UBn1tfRf6OdzaXDN6B9Vg6ol27VOecyRrO9HLid2Nd4=; b=eqmRNsAhJrgklCx87sDoM1xQqWHZNlPEBY9ug3G2VE4LmpWiFg6dzel0maM0Uh2W7f Cx27OcC9bFiRBk56TLkUf0RAiq0XZ2EJ7HNP9TKrJ6P7RPP8EwxZSfpTW2ZabWsQib4X wO6Nt7KhCmojuhSjmSyFBmhF1K8wJUn71PjOk1fVw//RT9quG7wFHcKdOTfHmaz5hIfr XDUCodpIEaF9qNRV3toOL52ZY6AewagSSM3jRzWaPvTz4krld8+el7KbcMwT5qKmzVFD AGn4YDvRJhOFvQKXzJjQV1Y2/+1MHe2Qq1rwFPKHbalfcREby3kEjKe8iPuF47gK9WT4 1Fhw== 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 m187-v6si50915754pfm.159.2018.11.21.02.20.42; Wed, 21 Nov 2018 02:20: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 S1729233AbeKUUxz (ORCPT + 99 others); Wed, 21 Nov 2018 15:53:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47806 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726001AbeKUUxz (ORCPT ); Wed, 21 Nov 2018 15:53:55 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CF8999C1C; Wed, 21 Nov 2018 10:20:04 +0000 (UTC) Received: from ming.t460p (ovpn-8-17.pek2.redhat.com [10.72.8.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0A4E5D75D; Wed, 21 Nov 2018 10:19:42 +0000 (UTC) Date: Wed, 21 Nov 2018 18:19:38 +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: <20181121101937.GA16204@ming.t460p> References: <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> <20181121034415.GA8408@ming.t460p> <2a47d336-c19b-6bf4-c247-d7382871eeea@grimberg.me> <7378bf49-5a7e-5622-d4d1-808ba37ce656@grimberg.me> <20181121050359.GA31915@ming.t460p> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 21 Nov 2018 10:20:05 +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 09:35:07PM -0800, Sagi Grimberg wrote: > > > > Wait, I see that the bvec is still a single array per bio. When you said > > > a table I thought you meant a 2-dimentional array... > > > > I mean a new 1-d table A has to be created for multiple bios in one rq, > > and build it in the following way > > > > rq_for_each_bvec(tmp, rq, rq_iter) > > *A = tmp; > > > > Then you can pass A to iov_iter_bvec() & send(). > > > > Given it is over TCP, I guess it should be doable for you to preallocate one > > 256-bvec table in one page for each request, then sets the max segment size as > > (unsigned int)-1, and max segment number as 256, the preallocated table > > should work anytime. > > 256 bvec table is really a lot to preallocate, especially when its not > needed, I can easily initialize the bvec_iter on the bio bvec. If this > involves preallocation of the worst-case than I don't consider this to > be an improvement. If you don't provide one single bvec table, I understand you may not send this req via one send(). The bvec_iter initialization is easy to do: bvec_iter = bio->bi_iter when you move to a new a bio, please refer to __bio_for_each_bvec() or __bio_for_each_segment(). Thanks, Ming