Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2580118pxa; Mon, 24 Aug 2020 19:23:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymZ9tRaE+vL1U35NKSQmqbX/GvesoMyZjoYquMSBOLulY95Cb4kXNgmweYoc1QE5Iyd3uN X-Received: by 2002:a17:907:35d0:: with SMTP id ap16mr8716800ejc.457.1598322233633; Mon, 24 Aug 2020 19:23:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598322233; cv=none; d=google.com; s=arc-20160816; b=i3R7khbT6+t4mHzG53ifFQl0y5dFvizIG+ZHNdirZI1rppwD+la/0RVyuJ+CkMAnDv NspPMvsLTgx4J6rv/JHN8mdbghFMXfWtXltoF+PUpsolmRLR5p5MI+EgUc/wrHp9hQ1B foycFAUa1WaIlBQOe+uQUSdM6PVe/Yv091atNax2Vaftnb8e3Uon8fgcn4u0ia7LCTHs qH+f2ITaJJlyN8/HrST2S7+mJ5FeoaoknFget/zF0AyaCqgZ24TpsHpzUYfFXJ2L1Qop OfvY4Cr3uoOEG2DBcJEXf6IgH/ygBMK9QO5oSc1M3VKqz4IYedX8UZVpJODWjaLHoAaE 1fYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5kN600Zk0Y9/rBk2J/ZVQxQah0yhjq2MAhbCl4FJF24=; b=EFEyfvMIPI/4vDucY1dXpQE54eenw2EGAJ0iHdPY+BAqoR/PHnhtPSk8oYV5fEVcmn ZVQkIU5KgWhqzZWkVYiGJj9RRaZgnffz4nVNkM0oJ6/fC6+/PBrsnfyYKDaKT+ZkAuET qhvYeaOpHBoJiRLOwgyFZNDh5eUcCgY76F7grvqaKLXaC/OOxodloeTlTIKF0Froj5hp Uf57SHDRYza0dXVBino/SV396cqGHGxqq3U88SdFLtfCVUo6lMLYeS5ookObSvAGHLVB 1qLGJurOlzwhoNtrvxRsGGjWfVwMJHEiJhTsY7ZlE4bA0Y58SpJ0oVuyGHPh0KfJZDBX oJ3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id us11si7917085ejb.699.2020.08.24.19.23.29; Mon, 24 Aug 2020 19:23:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727939AbgHYCWa (ORCPT + 99 others); Mon, 24 Aug 2020 22:22:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbgHYCW1 (ORCPT ); Mon, 24 Aug 2020 22:22:27 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1B02C061574; Mon, 24 Aug 2020 19:22:27 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit In-Reply-To: <3072d5a0-43c7-3396-c57f-6af83621b71c@nvidia.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: > > > > > Direct IO behavior: > > > > > > ITER_IOVEC: > > > pin_user_pages_fast(); > > > break; > > > > > > ITER_KVEC: // already elevated page refcount, leave alone > > > ITER_BVEC: // already elevated page refcount, leave alone > > > ITER_PIPE: // just, no :) > > > > Why? What's wrong with splice to O_DIRECT file? > > > > 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 і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 = 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.