Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1182389imu; Tue, 20 Nov 2018 13:05:55 -0800 (PST) X-Google-Smtp-Source: AFSGD/XqRv3tMS0b3zzny1R/If5T2+fOTkASDXKgqLsVyYVLlBT6Jyp9mRhWPcimTuOp0KUlyAwP X-Received: by 2002:a63:b218:: with SMTP id x24mr3270914pge.223.1542747955803; Tue, 20 Nov 2018 13:05:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542747955; cv=none; d=google.com; s=arc-20160816; b=WWJ0ve/aYbi1ckejA+Y4K04w97iADV+fO6/LsycJJSMzsWoM0Hp4w6kqlXhCkXBEIp 1CpsbpNpfEcax5TellUSBQnBlTSfM0vYWO/abGoe8Zi7Rp9wcE2pnETlyEL71cjWVHn8 RB37toaVOSOpJNN06kxhAiGkS+3Bd4048M2VzDFF0xtAek6f7fVKvFX/yRGN3z68qUIv yqYepuoPHn2O6dQwBkChuHV+gwTrOQl38PoQM/mM+H4qwAvYBgTbXWsNXvLmWNXlLUCL Z7vx+RiWcOW3mVjTBz378qzC+MRz43iOJa60kUesCN6i0GWMBXkqHstzDtKaE3Oa0jpd k6gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=+nDOz9mjqo4L3rzgAR7CUb2HdO4CSp5KgwQNxh2bwe8=; b=mu6ZBO/xxi4w0KHbT9ZCKt5smrrwmYgJl4Z5V0TtnaIHQPErc1yzXVi01N2GCBci2h K6yCctF6HfWfRmhSLfXk854wHhyqeGB+J0qDMMO2RmNclnbp6iPCqpUGT3fjrj95J5kG 8c+yMxcAq9MyYiysWZQ1CpEbHYpG8a3Dlq01ecznu3bF4uDH3K+bOsxpzRH4oSyhcSu/ w6lw628oEphIdK7jE/aQ4+7ZLjf5w4oTmHQwFKPGJMJGZ3Azd1AmtfmtTxABpAAxTTcH hIjn8tRbY49V0QVlUE1fUKDodzYpWaPYeZaUZ1NBNW38jtUNHIgJhErW6D0nXFPVBdGP qDUw== 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 cf14-v6si45987887plb.422.2018.11.20.13.05.38; Tue, 20 Nov 2018 13:05:55 -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 S1727572AbeKUGmf (ORCPT + 99 others); Wed, 21 Nov 2018 01:42:35 -0500 Received: from mail-oi1-f196.google.com ([209.85.167.196]:43936 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbeKUGme (ORCPT ); Wed, 21 Nov 2018 01:42:34 -0500 Received: by mail-oi1-f196.google.com with SMTP id u18so2575541oie.10; Tue, 20 Nov 2018 12:11:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+nDOz9mjqo4L3rzgAR7CUb2HdO4CSp5KgwQNxh2bwe8=; b=Xh3kdG12xmlmj21e7ZO8IEInjYVYIEQIrMm3zbzHJwrHOd2xnpumbiaCdLhfXCkzJC BtXnhe9VqNaZgv1izOhaI4nU+9fS2pkNUHkJJEPb47s9Dg8ttKZud0taRZJFk0gjo9Vj H8HQIfg/rSNHvyyrr66lNqMmRggNN8mmM1UWduw0VsXATL6UHPoxKjN5Fpl1P+9SLjqk 1oZHrvoBrV+4z9ibjWeS+H8R+uGuQS/Kktw/7gycGVj46w7W14PI1BBSnIdkpr6RqY2L wp4AqUhsZfF0vzaxK+4aEiJVZPmglVHYfS5NIgvJtayY2jGRxiAoxIB8tagAmeBAbKZn 7OkQ== X-Gm-Message-State: AGRZ1gK5hztfaZOmTBrEGaWzaYP5pEobcP1sPjDpWNcLnJAGnc2H6cJn z/1MRWvdzn3kXXhX+bxhIQo= X-Received: by 2002:a05:6808:13:: with SMTP id u19mr2037670oic.57.1542744699917; Tue, 20 Nov 2018 12:11:39 -0800 (PST) Received: from ?IPv6:2600:1700:65a0:78e0:514:7862:1503:8e4d? ([2600:1700:65a0:78e0:514:7862:1503:8e4d]) by smtp.gmail.com with ESMTPSA id i35sm13742439ote.69.2018.11.20.12.11.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 12:11:39 -0800 (PST) Subject: Re: [PATCH V10 09/19] block: introduce bio_bvecs() To: Christoph Hellwig Cc: Ming Lei , 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 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> From: Sagi Grimberg Message-ID: <53526aae-fb9b-ee38-0a01-e5899e2d4e4d@grimberg.me> Date: Tue, 20 Nov 2018 12:11:35 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181120161651.GB2629@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> The only user in your final tree seems to be the loop driver, and >>> even that one only uses the helper for read/write bios. >>> >>> I think something like this would be much simpler in the end: >> >> The recently submitted nvme-tcp host driver should also be a user >> of this. Does it make sense to keep it as a helper then? > > I did take a brief look at the code, and I really don't understand > why the heck it even deals with bios to start with. Like all the > other nvme transports it is a blk-mq driver and should iterate > over segments in a request and more or less ignore bios. Something > is horribly wrong in the design. Can you explain a little more? I'm more than happy to change that but I'm not completely clear how... Before we begin a data transfer, we need to set our own iterator that will advance with the progression of the data transfer. We also need to keep in mind that all the data transfer (both send and recv) are completely non blocking (and zero-copy when we send). That means that every data movement needs to be able to suspend and resume asynchronously. i.e. we cannot use the following pattern: rq_for_each_segment(bvec, rq, rq_iter) { iov_iter_bvec(&iov_iter, WRITE, &bvec, 1, bvec.bv_len); send(sock, iov_iter); } Given that a request can hold more than a single bio, I'm not clear on how we can achieve that without iterating over the bios in the request ourselves. Any useful insight?