Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4A36C433DF for ; Tue, 25 Aug 2020 02:22:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A20C72067C for ; Tue, 25 Aug 2020 02:22:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A20C72067C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 25463900027; Mon, 24 Aug 2020 22:22:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1DE118D0002; Mon, 24 Aug 2020 22:22:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 082D1900027; Mon, 24 Aug 2020 22:22:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0136.hostedemail.com [216.40.44.136]) by kanga.kvack.org (Postfix) with ESMTP id E1F5B8D0002 for ; Mon, 24 Aug 2020 22:22:28 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AE1901EE6 for ; Tue, 25 Aug 2020 02:22:28 +0000 (UTC) X-FDA: 77187491976.17.girl58_0708e2a27058 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 7DBE6180D0180 for ; Tue, 25 Aug 2020 02:22:28 +0000 (UTC) X-HE-Tag: girl58_0708e2a27058 X-Filterd-Recvd-Size: 2461 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 25 Aug 2020 02:22:28 +0000 (UTC) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAObM-004FIh-0R; Tue, 25 Aug 2020 02:22:20 +0000 Date: Tue, 25 Aug 2020 03:22:19 +0100 From: Al Viro To: John Hubbard Cc: Andrew Morton , Christoph Hellwig , Ilya Dryomov , Jens Axboe , Jeff Layton , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, ceph-devel@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH 0/5] bio: Direct IO: convert to pin_user_pages_fast() Message-ID: <20200825022219.GW1236603@ZenIV.linux.org.uk> References: <20200822042059.1805541-1-jhubbard@nvidia.com> <20200825015428.GU1236603@ZenIV.linux.org.uk> <3072d5a0-43c7-3396-c57f-6af83621b71c@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3072d5a0-43c7-3396-c57f-6af83621b71c@nvidia.com> X-Rspamd-Queue-Id: 7DBE6180D0180 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Aug 24, 2020 at 07:07:02PM -0700, John Hubbard wrote: > On 8/24/20 6:54 PM, Al Viro wrote: > > On Fri, Aug 21, 2020 at 09:20:54PM -0700, John Hubbard wrote: > >=20 > > > Direct IO behavior: > > >=20 > > > ITER_IOVEC: > > > pin_user_pages_fast(); > > > break; > > >=20 > > > ITER_KVEC: // already elevated page refcount, leave alone > > > ITER_BVEC: // already elevated page refcount, leave alone > > > ITER_PIPE: // just, no :) > >=20 > > Why? What's wrong with splice to O_DIRECT file? > >=20 >=20 > Oh! I'll take a look. Is this the fs/splice.c stuff? I ruled this out = early > mainly based on Christoph's comment in [1] ("ITER_PIPE is rejected =D1=96= n the > direct I/O path"), but if it's supportable then I'll hook it up. ; cat >a.c <<'EOF' #define _GNU_SOURCE #include #include #include int main() { int fd =3D open("./a.out", O_DIRECT); splice(fd, NULL, 1, NULL, 4096, 0); return 0; } EOF ; cc a.c ; ./a.out | wc -c 4096 and you just had ->read_iter() called with ITER_PIPE destination.