Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2573856pxa; Mon, 24 Aug 2020 19:08:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3ym/yRzbMSXsDlKpORLj1jwyej0yL1BVFh+wpv/Q2MdTTwAg+F9/8MUbxFR3u2ap65Q0g X-Received: by 2002:aa7:dc44:: with SMTP id g4mr8236969edu.273.1598321291956; Mon, 24 Aug 2020 19:08:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598321291; cv=none; d=google.com; s=arc-20160816; b=u3jt2ku0brfReeZyFceQq2q7HcTrRcOcMkO3DxzN9/DBu4xs5gRmD+AHYC82c7Uaj6 uGcdTT2pYECU8hV4Usf88LVJrZJIFRfJCquYLtWGWQLCSroylNgyhoLMKl0GIWMrkP1S FQDYrhRGoNzznfQJTzIv+Q4tuIza+jyI3rGz7mzvEL2FhWlQTT2f4vKQnwLH5iojWQqz 1XkcAAEd4A5W7SlC03BtphxFyeOuQMPdnzgfwoTWgHhuEgkJYoG9BJ5cUtcnRsMGZBYJ cqa6blXz36B0CsPWCkLNDZbCAqwvLQbvuuY5iTSbW31JXDIOVMUJwlxDxdcTKoVtnws2 2ViQ== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=qWXvvYs/+jDAcHGLCMEVK9kPAzxo9bm48gq+qqqXk3E=; b=UTVc2NQi0q+tQRFGoYL2zs5nZ5VdzC9yUcQtSwfwGNYEV+3RnjLzF4ROXYQe2E/FAO Q7saVhzFwBfa4/6QLTcPTL2acgE5tYjpMJ3gy24mKi1i+N9c2aKtzff6XMVi7VhU8LlD EwsahukP43xePKtxLXZkJAjkadZaPlWFPOLos3VAh+k6PKxxfo2nQis+Qk1Oq/kWalFO slLSHxpA2OpaRmd1RR2gEZSjgboAYHLS6/1bnjdKqAOJD2uI8lIja5HwFJ4Hf+/zkxD6 AI8Sl65BK/wIOPGSSlT19cjr0E6fiBHxjCT515s4cf9SVUoE8/HgA2RpohJ7KBnu3Dqd SP5w== 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 gz19si1856599ejb.176.2020.08.24.19.07.48; Mon, 24 Aug 2020 19:08:11 -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 S1728002AbgHYCHK (ORCPT + 99 others); Mon, 24 Aug 2020 22:07:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbgHYCHG (ORCPT ); Mon, 24 Aug 2020 22:07:06 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E6CAC061574; Mon, 24 Aug 2020 19:07:06 -0700 (PDT) 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?