Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1785378imu; Wed, 21 Nov 2018 01:48:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/XUMakp3xTRaVFwg30Ph0wIqBmU7NgedkcPoZ83PpvTCxvWPdNfaMQE/Uv59Zo3ww0B8BqV X-Received: by 2002:a63:e055:: with SMTP id n21mr5346578pgj.397.1542793704230; Wed, 21 Nov 2018 01:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542793704; cv=none; d=google.com; s=arc-20160816; b=DEfCx7DO0fBWp/uHETqG3iYB2F5MASWE2ACf7aVEE6GaW4COFvcuGzICOX1axupCfP 1cTNrtNb/6SCl/lyRCIGZKo6/8rNCPzeYj7of8aO4xGQBF8n7y/zkQVYHJqfq/QXjC3o KzeHHod2Yc2EeqGwFEB1G+/lrNPwGOecwMFQh5C7oyw/vjiOpCZ5l7eOIWPimNcceE3l JwBViAUfQ2+O4fkQf2UdI3YT6kYrF4imRdtFcJKdut7SLAqDQJ8XpShAO2KVC17/GD1K XD4MvH9ckM0tetVYa2rcTTd5J5hrWgTvDksPRquDLf/13KtN9qS8oZ6yS8i/j7gI6dNr KdFw== 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=dLWnbJpypW0KTNcx37rWx7jNK6aIAwyEFa0iwIIW/nk=; b=qPuf7p2iehe5+9ymjrQziGMkcl7ARJsDsruGTFtJpWG3uWf5b7HkTKEJMdYbhPRbxn Wv4bkTjO2ZVJ/OLLkCg1uTC7VpOu9FwxiabAFTo/b928Td8TZTfZqiQlB/9mwSdCbWqI qwWEDj8dskE6xyIIZjzlypTMLKLyDpKHOBjdM8aRSOi1iMQh6H5tW+Y+8kJsQT8qrsPm ogas0xBNLu758OoBzXMVJN7riAJUzA3nbmqLw43XuLs4iIXa2LDhrqa+pVc5Rh64tF85 uTWNXUlOIodg1lt9jAwh/wn825Eha+1FTezeXncj3bBraodx2AN6isEYEM8BMYd4PZjV FEfQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92si1329328plw.158.2018.11.21.01.48.08; Wed, 21 Nov 2018 01:48:24 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728392AbeKUTTs (ORCPT + 99 others); Wed, 21 Nov 2018 14:19:48 -0500 Received: from verein.lst.de ([213.95.11.211]:50061 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728210AbeKUTTr (ORCPT ); Wed, 21 Nov 2018 14:19:47 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 4F0CA68C19; Wed, 21 Nov 2018 09:46:08 +0100 (CET) Date: Wed, 21 Nov 2018 09:46:08 +0100 From: Christoph Hellwig To: Sagi Grimberg Cc: Ming Lei , 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: <20181121084608.GA29622@lst.de> 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.5.17 (2007-11-01) 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: >> 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. Ok, I took a look at the nvme-tcp code and it seems you care about bios because you want a contiguos bio chunk for sending it down the networking code. Yes, in that case we sort of need to iterate over bios. But you already have a special case for discard, so you don't really need any of the magic in the bio_bvecs() helper either can can just count bi_vcnt in the bio.