From mboxrd@z Thu Jan 1 00:00:00 1970 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 25614C433E1 for ; Tue, 25 Aug 2020 02:07:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E92E5204EC for ; Tue, 25 Aug 2020 02:07:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E92E5204EC 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 76321900022; Mon, 24 Aug 2020 22:07:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7154C8D0002; Mon, 24 Aug 2020 22:07:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 62A3C900022; Mon, 24 Aug 2020 22:07:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0119.hostedemail.com [216.40.44.119]) by kanga.kvack.org (Postfix) with ESMTP id 4B0D48D0002 for ; Mon, 24 Aug 2020 22:07:08 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 19BE6362B for ; Tue, 25 Aug 2020 02:07:08 +0000 (UTC) X-FDA: 77187453336.30.plant46_350cf8327058 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id E6C2B180B3C83 for ; Tue, 25 Aug 2020 02:07:07 +0000 (UTC) X-HE-Tag: plant46_350cf8327058 X-Filterd-Recvd-Size: 2173 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [195.92.253.2]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Tue, 25 Aug 2020 02:07:07 +0000 (UTC) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kAOMW-004EtK-7m; Tue, 25 Aug 2020 02:07:00 +0000 Date: Tue, 25 Aug 2020 03:07:00 +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: <20200825020700.GV1236603@ZenIV.linux.org.uk> References: <20200822042059.1805541-1-jhubbard@nvidia.com> <20200825015428.GU1236603@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825015428.GU1236603@ZenIV.linux.org.uk> X-Rspamd-Queue-Id: E6C2B180B3C83 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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 Tue, Aug 25, 2020 at 02:54:28AM +0100, 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? Sorry - s/to/from/, obviously. To spell it out: consider generic_file_splice_read() behaviour when the source had been opened with O_DIRECT; you will get a call of ->read_iter() into ITER_PIPE destination. And it bloody well will hit iov_iter_get_pages() on common filesystems, to pick the pages we want to read into. So... what's wrong with having that "pin" primitive making sure the pages are there and referenced by the pipe?