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 2A574C61DA4 for ; Fri, 27 Jan 2023 12:30:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 88AE46B0071; Fri, 27 Jan 2023 07:30:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 815B76B0072; Fri, 27 Jan 2023 07:30:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 68EC86B0074; Fri, 27 Jan 2023 07:30:34 -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 53A256B0071 for ; Fri, 27 Jan 2023 07:30:34 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 26C5B80FD1 for ; Fri, 27 Jan 2023 12:30:34 +0000 (UTC) X-FDA: 80400512388.20.45E5F36 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf13.hostedemail.com (Postfix) with ESMTP id 259C720018 for ; Fri, 27 Jan 2023 12:30:31 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=FGtVF+if; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=PJzXU1bK; spf=pass (imf13.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674822632; a=rsa-sha256; cv=none; b=C3Ow2QOmp/Hyf6bR626uTQUjq9vzvPBCp4JqhSm3y3T8a8dhvtXb5cUrcna3vCe//OAhNp RhOf54jlSBOP0qOU5TwCojBojvu4AeLK9zKyIVO6Z9RaL3PO6NUxq+jgf2mdoQq5TgJ0O5 DBLT3b4HMc+waB+gUKizT1S6UXKEdio= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=FGtVF+if; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=PJzXU1bK; spf=pass (imf13.hostedemail.com: domain of jack@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=jack@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674822632; h=from:from: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=Ko++EeK7T8bysS2hwsZBCuH6k1F9U9HYKOhMMBm7aVY=; b=rrqzbZp7KGqJKIcNZ7F3Y6tVOEm7AllBL14fpzFzYlXOvUfYmoIb3zMQysydG8TpfQtM5Q bVDflXS2knnBmr8WsAPYN/DW66ge0ZRT3Hvkl8yN5Xzx+aBQWGPsJr/OD3gMU3WsvziJJI vhsbpuCDVd13a3vGhoc/AkIWrhIRPwA= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B46311FF3C; Fri, 27 Jan 2023 12:30:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1674822630; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ko++EeK7T8bysS2hwsZBCuH6k1F9U9HYKOhMMBm7aVY=; b=FGtVF+ifDnNx6Ym7llm38UK0noTKXOhkytSeYRdluDJLLqQIsshL81BuksR1kFhKBdijor B21PwWeGt/tqSlcwQnqrseZzrUZ9lVGdBAj+l89IFPnGZNQCE7BPnIXzh1i1pnWRZr3+r7 MlzsJfWufGeTwBGvEQ8mMt08sdoaPP8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1674822630; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ko++EeK7T8bysS2hwsZBCuH6k1F9U9HYKOhMMBm7aVY=; b=PJzXU1bKZhQ0pDU38zzQdBDzy4U7+UqpT+D3hZZSt5+0OSmJslprdKrGnA/pq6n8caqZ/l WJ8T1oIkdniJBKAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9CDE5138E3; Fri, 27 Jan 2023 12:30:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /AlHJubD02O9AgAAMHmgww (envelope-from ); Fri, 27 Jan 2023 12:30:30 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 24CD6A06B4; Fri, 27 Jan 2023 13:30:30 +0100 (CET) Date: Fri, 27 Jan 2023 13:30:30 +0100 From: Jan Kara To: Al Viro Cc: David Hildenbrand , 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: <20230127123030.qfmgkthuzlxadpkk@quack3> 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-Rspam-User: X-Rspamd-Queue-Id: 259C720018 X-Rspamd-Server: rspam01 X-Stat-Signature: 75sb7cbnb58hfd3jkfs7ck9accnub6j4 X-HE-Tag: 1674822631-578553 X-HE-Meta: U2FsdGVkX1+1RsKOF9g/42Ply0PctLPtDvrjfu+y7GO86qYAPWq1YuYBX2MvI8pIyJA0jwWfTiwwEhUtQINYN8xaR9tdxzpglGZewguWIR4VL8qKAGyjKniZgzcP/ojWqp16ci+uzppSXxlkD34pGiGWrM+FqzpdmiBnfUwmABEN1u5npJyOfhGVfiRgh3wwjrp4AqQsgx0BHlrvIfhgKo4nAijfxnFLi76vCj2MhLkCYAQkQyFz7UglGQTemF1Rli/IfUwPFYio0YrXl6WES2Z24iU4v4c0jFMaHq+3n1oMcTIlrVlSYig6+aS4jHlZF9LwsRYCtb1oH3AjjfwASRzOG6jmObBiB3dvSWTcbMgYDNps8KxCWG1AiwhRRfmil83/lipjY23ZV37HzHanQQUuPGeqOisKg6A5CAP6bj25CErl3eAUiKLfMP2XKplMNrWSQPhlAQbNZCah/EppuE3k5jRLUDXUvIO3cwysrvlqTCxGWDTuvRzmR+9kzCx+OxJWAPKQ5HDfEdnb7pQpFgE8ltzJ6mKIISx82xcdMdzaOSxXj8ckuHPIJYBdkBwYYT724nPfcrUtfTifNghCmwSdILvK44UUmHdgOrkoSm+IdkVa8uBuRvnnwdpz1upZi+fxa1gF0PmoY8rCJv/gyknUt/3JjUzmqr4rDKUd1NSaswHLyV/j3clU2wmJXeyg4z2jDEFcBgjIa+NrW9MeJdG75TBE6FS6aoPjDr2nFIpCPEBD+oSeoHyhtfsqZkRHkbAkQ4ZOz4/xyD1cdGzpPExxUawk4BGuVUNUm0vKa+e0L7ILtq5fIXY7HW1Ez2S0zwTA/qGtm44/QZdk+Q9A0Ld/Vhz/haDkQvl1yfneUWYrgaiLxIkusunZc5Crkd+zGzdN/XJXaaiR6yMSMhMEIByYirRHDju6yNcl/bTI68ge2J0uW91dUJPXJb9aPr3Zq6omoCzRswst6E59xZ7 VA/KGedG p0ENrWxBy9lDzShf8s1lf1Yav6RGPWcTFoE6RPIp7pAWId2c/EhN0jNwN/8ynsWngqd7wDIO8mcoOXs+7C/tSR0OHHy6+q16SJIGFA/mO7VI9YJycClsJ9rYMddJuABJv0k18eFtsTbjvjFINezIN4LXic6UcHgZoUAB56ec2UHGN3AA8QzcFC/I4/vvSQclmUSG+Dv5Fa6CktXmRJDkgI94N7UQX0UdAQoRolvzpTzihO5LMWpoZB8FmlrsCNggBt/eAvExzeubCAbxwnRydBmv7Dj+sYWU24bj9Hj103BvvrCB0nVlhAt8PK+0F0gYs75AEgh9HUmSieN+5n8fTJGMn8W7d5JeXhYzwpXj/i2Hd6+q+3zAKuF+2sy3sZPs9TJBi 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 Fri 27-01-23 02:02:31, Al Viro wrote: > 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? Yes, that's the plan. Because as you wrote elsewhere, it is otherwise too easy to lock up operations such as truncate(2) on DAX filesystems. Honza -- Jan Kara SUSE Labs, CR