From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2CED8460 for ; Wed, 17 May 2023 07:29:24 +0000 (UTC) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A9D01717 for ; Wed, 17 May 2023 00:29:22 -0700 (PDT) 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 E7188204F0; Wed, 17 May 2023 07:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1684308560; 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=eii5ss2ocLxG8N7/nX823yY9WNM71xoVrkq3X6PC3iI=; b=ThXAnaVWBGnnqBZtfbIMAR0hX/ao8ZQHdKq6svUyFCGqgSRIQebsWzx75B3g/D/gG4ejjv QaLP54aZzFaHQx2Dg5lU8zRK1mmgsRbSUU7B+ovHSoAcA9qR9AaCCE307BHiCSIk465hsb 5SdskPkCEIF9cdXAtjy2OKwS211WmH4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1684308560; 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=eii5ss2ocLxG8N7/nX823yY9WNM71xoVrkq3X6PC3iI=; b=Sqz/WI6g7ZxcFMqyFw1GiD4SEGIqElhv22w5+UkXvSfuSPLuSi7teR9RomQymrT67sPYHd Mb3rwK1NqgaOfQBw== 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 D691B13478; Wed, 17 May 2023 07:29:20 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ef9GNFCCZGSlDQAAMHmgww (envelope-from ); Wed, 17 May 2023 07:29:20 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 24F03A0735; Wed, 17 May 2023 09:29:20 +0200 (CEST) Date: Wed, 17 May 2023 09:29:20 +0200 From: Jan Kara To: Lorenzo Stoakes Cc: Jason Gunthorpe , "Kirill A . Shutemov" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Jens Axboe , Matthew Wilcox , Dennis Dalessandro , Leon Romanovsky , Christian Benvenuti , Nelson Escobar , Bernard Metzler , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Bjorn Topel , Magnus Karlsson , Maciej Fijalkowski , Jonathan Lemon , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christian Brauner , Richard Cochran , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , linux-fsdevel@vger.kernel.org, linux-perf-users@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Oleg Nesterov , John Hubbard , Jan Kara , Pavel Begunkov , Mika Penttila , David Hildenbrand , Dave Chinner , Theodore Ts'o , Peter Xu , Matthew Rosato , "Paul E . McKenney" , Christian Borntraeger Subject: Re: [PATCH v9 0/3] mm/gup: disallow GUP writing to file-backed mappings by default Message-ID: <20230517072920.bfs7gfo4whdmi6ay@quack3> References: <20230515110315.uqifqgqkzcrrrubv@box.shutemov.name> <7f6dbe36-88f2-468e-83c1-c97e666d8317@lucifer.local> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On Mon 15-05-23 14:07:57, Lorenzo Stoakes wrote: > On Mon, May 15, 2023 at 09:12:49AM -0300, Jason Gunthorpe wrote: > > On Mon, May 15, 2023 at 12:16:21PM +0100, Lorenzo Stoakes wrote: > > > Jason will have some thoughts on this I'm sure. I guess the key question > > > here is - is it actually feasible for this to work at all? Once we > > > establish that, the rest are details :) > > > > Surely it is, but like Ted said, the FS folks are not interested and > > they are at least half the solution.. > > :'( Well, I'd phrase this a bit differently - it is a difficult sell to fs maintainers that they should significantly complicate writeback code / VFS with bounce page handling etc. for a thing that is not much used corner case. So if we can get away with forbiding long-term pins, then that's the easiest solution. Dealing with short-term pins is easier as we can just wait for unpinning which is implementable in a localized manner. > > The FS also has to actively not write out the page while it cannot be > > write protected unless it copies the data to a stable page. The block > > stack needs the source data to be stable to do checksum/parity/etc > > stuff. It is a complicated subject. > > Yes my sense was that being able to write arbitrarily to these pages _at > all_ was a big issue, not only the dirty tracking aspect. Yes. > I guess at some level letting filesystems have such total flexibility as to > how they implement things leaves us in a difficult position. I'm not sure what you mean by "total flexibility" here. In my opinion it is also about how HW performs checksumming etc. Honza -- Jan Kara SUSE Labs, CR