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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72E1EC54EAA for ; Thu, 26 Jan 2023 22:15:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D2C5A8E0005; Thu, 26 Jan 2023 17:15:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CB6138E0001; Thu, 26 Jan 2023 17:15:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B55F38E0005; Thu, 26 Jan 2023 17:15:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id A19058E0001 for ; Thu, 26 Jan 2023 17:15:29 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 57E69140E70 for ; Thu, 26 Jan 2023 22:15:29 +0000 (UTC) X-FDA: 80398357578.16.E91F8C9 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) by imf29.hostedemail.com (Postfix) with ESMTP id 87704120002 for ; Thu, 26 Jan 2023 22:15:27 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=poCgIh0b; spf=none (imf29.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 62.89.141.173) smtp.mailfrom=viro@ftp.linux.org.uk; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674771327; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=jd/5WIrcHcZzAYHPugOmZ9o+ttQGJRTdajMdq6eexVQ=; b=S6dh5t9LuPQxay0qrfDuPdL0iyZHpSQMqyyre/uYUrINdrAAns/SAJVt6ikVdpYrY03MTN S+xidJ13Xl2QhKVYYM+OLoO8mrhi4xcyaIHXsYKkLYsiRk1G8wUoJ57NOsk9FfPtau35Mv WTtG+9vEDaI3KN1NBZFgeQtb5mUfyPw= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=poCgIh0b; spf=none (imf29.hostedemail.com: domain of viro@ftp.linux.org.uk has no SPF policy when checking 62.89.141.173) smtp.mailfrom=viro@ftp.linux.org.uk; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674771327; a=rsa-sha256; cv=none; b=Fv2XStMU9q7hGpUoO0sfSejjd/DWvtE31up1B0e6oVpFXjODuhRyKlsP5JO5Y5QLk6apoj LHgmq9bOau41+tayE7TwUWq1bEhVfE4LqncbwwQ43QgIeGEtyEbNFK8Qb6Rc4LdcNM0Hfm /zwfIVeXo54FxlRzq8yT8xPGjGw4qQs= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jd/5WIrcHcZzAYHPugOmZ9o+ttQGJRTdajMdq6eexVQ=; b=poCgIh0b2tUBO/p9HbXoT9N6pJ zx+i2ZI4FFh50Ucj8MSNsEEJO+ir8dAn3D9mfCbSJ9/hghKTWm+vntEsb7hSTR4ZC+k59zRY/3bHA Jvs3efe71mZtbyvytGsKHk4Gah85oxCcnzMlmy2a0Vipjz/0LXhXLHFxEP0jLg5Pj7bwnutTI+Bsr klni0UFu3h603jdMcn+xvTdmOG4Y9x7/NZJJ0FK+42PBt+LcjHCqy8nchhFPYVNi+6PFTrbkaG77u zkRxfm+dNHWlGVSfeunz2AczKYTDikGJPapL9hwGHHk6SzhXMnGiRPsQHaUhB/rYixXLWyNBGIa01 aKIUcTcQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1pLAWX-004KFl-0g; Thu, 26 Jan 2023 22:15:13 +0000 Date: Thu, 26 Jan 2023 22:15:13 +0000 From: Al Viro To: David Hildenbrand Cc: David Howells , Christoph Hellwig , Matthew Wilcox , Jens Axboe , Jan Kara , Jeff Layton , Logan Gunthorpe , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , John Hubbard , linux-mm@kvack.org Subject: Re: [PATCH v7 2/8] iov_iter: Add a function to extract a page list from an iterator Message-ID: References: <7bbcccc9-6ebf-ffab-7425-2a12f217ba15@redhat.com> <246ba813-698b-8696-7f4d-400034a3380b@redhat.com> <20230120175556.3556978-1-dhowells@redhat.com> <20230120175556.3556978-3-dhowells@redhat.com> <3814749.1674474663@warthog.procyon.org.uk> <3903251.1674479992@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: ctnhr4ijpbm6z6a6mqr7f5gwgn8ka7jf X-Rspamd-Queue-Id: 87704120002 X-HE-Tag: 1674771327-315008 X-HE-Meta: U2FsdGVkX1909HfWfgAYO6Q1NOGkvt0y0t4Ro9ijh2AZG9/hzLLxe6ejoV3rROMK/5Gl0gRgfliGk6OtXJvF52dUrn7a4QKWhUo4ZnL5NBagMmFsKYj1gsW2iHP/0PupjcC501dQyhvxNXiNl7PyjoTiF0H90k3nLWAXH5f1/rprfcKX3pfBxSRM8i7+JaBzy7SPkYxIg3/KnZm9TIf6DNtrgk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cD1RMhL3oXujhQzdiHUy07thBMf3vqOjNxXbacgFXxdN4WnPl3/aQTzLSOpP1o87o+/TXiCqlgPsX11n8djICboZQryRs5wBD2u6eQTqeimkbFP7G/3/iSEYA5Q0kPZLYfu80m8pEE7ymRN+hMtF6g/r9amBRbcODTJdeC7qACB5oUy1GEIUmdAIs1LZBDVFL/L8lHItlA== 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, Jan 23, 2023 at 02:24:13PM +0100, David Hildenbrand wrote: > On 23.01.23 14:19, David Howells wrote: > > David Hildenbrand wrote: > > > > > Switching from FOLL_GET to FOLL_PIN was in the works by John H. Not sure what > > > the status is. Interestingly, Documentation/core-api/pin_user_pages.rst > > > already documents that "CASE 1: Direct IO (DIO)" uses FOLL_PIN ... which does, > > > unfortunately, no reflect reality yet. > > > > Yeah - I just came across that. > > > > Should iov_iter.c then switch entirely to using pin_user_pages(), rather than > > get_user_pages()? In which case my patches only need keep track of > > pinned/not-pinned and never "got". > > That would be the ideal case: whenever intending to access page content, use > FOLL_PIN instead of FOLL_GET. > > The issue that John was trying to sort out was that there are plenty of > callsites that do a simple put_page() instead of calling unpin_user_page(). > IIRC, handling that correctly in existing code -- what was pinned must be > released via unpin_user_page() -- was the biggest workitem. > > Not sure how that relates to your work here (that's why I was asking): if > you could avoid FOLL_GET, that would be great :) Take a good look at iter_to_pipe(). It does *not* need to pin anything (we have an ITER_SOURCE there); with this approach it will. And it will stuff those pinned references into a pipe, where they can sit indefinitely. IOW, I don't believe it's a usable approach.