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 21E17C54EAA for ; Fri, 27 Jan 2023 02:02:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8639E6B0071; Thu, 26 Jan 2023 21:02:53 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7EDAE6B0072; Thu, 26 Jan 2023 21:02:53 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6B4BB6B0074; Thu, 26 Jan 2023 21:02:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 57DFB6B0071 for ; Thu, 26 Jan 2023 21:02:53 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 29474406DD for ; Fri, 27 Jan 2023 02:02:53 +0000 (UTC) X-FDA: 80398930626.17.74A5628 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) by imf03.hostedemail.com (Postfix) with ESMTP id 519C020005 for ; Fri, 27 Jan 2023 02:02:50 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=RylZnR9u; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk; spf=none (imf03.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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674784970; 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=PK9c5BIZ/2zl/kbi/P3CFpqoz5RNvD3sK2pvPPas0Ak=; b=UwIdKQfYj7xD3PYoSF4u2gOHYzCuIDljMmOfd1pne7lhEDC9eZbsNX54kgi2iR3lWHH2B9 wDpWqRzcbdVShJHW+jWeZGQ+BM4o0cwdPgpyqE4O5estErr9k8CbylP/QuunkaMNEWcgMr quQJInDRi2+Diad+dBRZSvGYsIstwls= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=linux.org.uk header.s=zeniv-20220401 header.b=RylZnR9u; dmarc=pass (policy=none) header.from=zeniv.linux.org.uk; spf=none (imf03.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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674784970; a=rsa-sha256; cv=none; b=V6xjUVdpWRrNTy+JWvPi4Evu2vZberGdtMas1eYiWZh3aHFa4n/GS079lX2uVRSZBoTaeA OIRbzGhMbrNOtTigwzOia3sa6JDluf4DdOhcNGB52wgbRrfQpvsw6RBCHQ7Wz1GQ1wWQb1 uQuYSitmG/34oWFtVleSZacwLzzvgMA= 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=PK9c5BIZ/2zl/kbi/P3CFpqoz5RNvD3sK2pvPPas0Ak=; b=RylZnR9uWIvzX4rWuBzjZyKE88 p7IhXapBv2ZuJ8A5mNdHQ/M4MSSpH2DhYndse8MHfUKjUVpOimHisD8sYwAXacgUuraHI26wQLGfA ZTOuH9+ysl18EC/pf4TBjGlgbm/+l4BAfxy/B3Dqxb1oCo3ERvTttDRm4VN8M+WXYsbtFZD0QYRXK EZ54JgXXmPhXCsE3YKPxtOFagSMtMtW57bXiCDmHrYqa6qm4cGZXRgfODjLrfV/nI2Omrl3u8hbAc 7Uu9Szo5UwLkvwyZhqqXASLKT5SrFZM9KyoOlQ52YNg9Yg48+zdsWK21Jwik8hMSF/bAvz1SCSDR3 eesAwG3w==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1pLE4V-004MLo-24; Fri, 27 Jan 2023 02:02:31 +0000 Date: Fri, 27 Jan 2023 02:02:31 +0000 From: Al Viro To: David Hildenbrand Cc: David Howells , Christoph Hellwig , Matthew Wilcox , Jens Axboe , Jan Kara , Jeff Layton , Jason Gunthorpe , Logan Gunthorpe , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig , John Hubbard Subject: Re: [PATCH v11 2/8] iov_iter: Add a function to extract a page list from an iterator Message-ID: References: <20230126141626.2809643-1-dhowells@redhat.com> <20230126141626.2809643-3-dhowells@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 519C020005 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: gqhmd56wyh9yec6zye44utdcws57zy7t X-HE-Tag: 1674784970-996641 X-HE-Meta: U2FsdGVkX1/MiU8F9Lm1b/PbPdC65X6Y/Z0/YmWRSqmmnTmsG57edjH7LdwzpjoVMGG60UvnahoNrVPRiJgIDtvxn6CLL4rDsL2GR30IRcPRL44+1rnB503ysQ2mta7eOJNop1fp37JZCcfjVphTtvwa1sk7/ptQn7AQEmILxRivsvH5FMKOxRg47sRckMDQ0tFWeguWumb74vIx539asvcYAnvSb7NtKaN5+SZM1n/oci2aIEG+LiC2GQ0mktFq4wa7FNbhiYm76Hqp0tlRCj1mX2IwTSPPeuPV20WmPJ09ryltBLVQnR3bmVlpkFKJEFzokomXR0dFUsRnvYCQWG6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SyzH5pQ9DvFwLou2mXzrXUYBIsRyL//4Z9VxZTRb X-Bogosity: Ham, tests=bogofilter, spamicity=0.000021, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jan 27, 2023 at 12:44:08AM +0100, David Hildenbrand wrote: > On 26.01.23 23:36, Al Viro wrote: > > On Thu, Jan 26, 2023 at 09:59:36PM +0000, Al Viro wrote: > > > On Thu, Jan 26, 2023 at 02:16:20PM +0000, David Howells wrote: > > > > > > > +/** > > > > + * iov_iter_extract_will_pin - Indicate how pages from the iterator will be retained > > > > + * @iter: The iterator > > > > + * > > > > + * Examine the iterator and indicate by returning true or false as to how, if > > > > + * at all, pages extracted from the iterator will be retained by the extraction > > > > + * function. > > > > + * > > > > + * %true indicates that the pages will have a pin placed in them that the > > > > + * caller must unpin. This is must be done for DMA/async DIO to force fork() > > > > + * to forcibly copy a page for the child (the parent must retain the original > > > > + * page). > > > > + * > > > > + * %false indicates that no measures are taken and that it's up to the caller > > > > + * to retain the pages. > > > > + */ > > > > +static inline bool iov_iter_extract_will_pin(const struct iov_iter *iter) > > > > +{ > > > > + return user_backed_iter(iter); > > > > +} > > > > + > > > > > > Wait a sec; why would we want a pin for pages we won't be modifying? > > > A reference - sure, but... > > > > After having looked through the earlier iterations of the patchset - > > sorry, but that won't fly for (at least) vmsplice(). There we can't > > pin those suckers; > > We'll need a way to pass FOLL_LONGTERM to pin_user_pages_fast() to handle > such long-term pinning as vmsplice() needs. But the release path (unpin) > will be the same. Umm... Are you saying that if the source area contains DAX mmaps, vmsplice() from it will fail?