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 95913C77B75 for ; Wed, 17 May 2023 07:29:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 19030900004; Wed, 17 May 2023 03:29:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 14167900003; Wed, 17 May 2023 03:29:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00836900004; Wed, 17 May 2023 03:29:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E3F1A900003 for ; Wed, 17 May 2023 03:29:24 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B2BC6160465 for ; Wed, 17 May 2023 07:29:24 +0000 (UTC) X-FDA: 80798921448.25.DA15037 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf06.hostedemail.com (Postfix) with ESMTP id A68F7180002 for ; Wed, 17 May 2023 07:29:22 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=hQvUWIwV; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=6b8pr7Ag; spf=pass (imf06.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=1684308562; 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=eii5ss2ocLxG8N7/nX823yY9WNM71xoVrkq3X6PC3iI=; b=OmNw7SeJA3xrVIP7LBhuOWvA6bcjSLaXR4m0HQFn0LUpAjEqwWW7fNYaO8SbrP3C5Ot1xP FvtJFmJnz/S3KMSalGqgvj6ZCkIFD6UdCUVgQnwJjXiQp/I12Khn6kCIUAro6KIduXsaZu L2KKyVTN4K6yErOJIixGJzNYIM2Cw8A= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=hQvUWIwV; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=6b8pr7Ag; spf=pass (imf06.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=1684308562; a=rsa-sha256; cv=none; b=fgOTCjpIx2DwkHrvkoqQfQOCXP1O+v4F1oqdFdQTtprGIg96zKTwANtNoplJ2PoGUScuDx g+u1lyrHD0bbYVRdyMWkLKCfgekMcOs392VbkmoPQ9LWKfvPIEKAtxrNRm311NVdpYrZvU rtKtce7FFDUSZvfXnH5A52iC2UQuEqc= 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 EF577204F8; 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=1684308561; 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=hQvUWIwV6dCGwuy3cNq5IQT6P4+C/VAVmwLb4GtYKRRH2ugi1jPXhCde+huPj1CQ4BTIvb Mq7gF5pblxgfVMZ0MzePq08W3e416/qsT2eooe28/Ge9FinmDOZxJd/ttsaYqUU6FtLcXy 3WifwYteFwOXitONZ5p8n1bpd6ozBMk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1684308561; 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=6b8pr7AgWnQi46BzKh0rbfqRBGeaL4LkESIM594OVIo6t6RKDV5ot9JIBptg6ZdgmCqX7G 5J23DXq7PolfGmDw== 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 D8A75139F5; 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 q0FVNFCCZGSmDQAAMHmgww (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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: A68F7180002 X-Stat-Signature: ff4iedoiwmqgz8yap4skbowww6utjogb X-HE-Tag: 1684308562-437035 X-HE-Meta: U2FsdGVkX1+AlfMrEI6AVpIiBzAA+Iz5JKJyi+7p02PEr/V559Xnr/Als5PACvOG0TTH+PXO+PU2VnTAH85W9zEnUY6wTHEvyiZOIYRx3yg2AzRxPqWHs/fktNQAwGa0I/2T5OlU6MrI+vN6PWC29lLGKNK6ygJhRyOXxLUcEFlNOjDFAuxRH9bV1L0Mz6jGIxTLj9qZ12k9Pq0mWUPOb6CKTEL4aJ3G75e1/AxRKIal9R3fhfby3pRXdBmX6l/0Qo0xScPZK814SCWweJf/SNyUP9z97oKZnsLRytZjxwqMYwzhyRBNPvMWqn3VWWds6y1B/j+3a2MEZcnsHSI2ztwfgvpyQg4QhhITI91WBU+GaBpxsInt1yf8xg6Xal+4dBL6SmSwC/seBg6PU2EI5nxRPCwOKywRWwv5Zg1EyoyYXKOtLbZBcVEO9kA6FlV2hq8uSCMs7lGppHXotUqVzOto/LdnJ2dDYmZSIQwJ4u3t9wPPz008ejxQ//GO5//bX+WrepG+jKIMrSgAcvXdiSvjEIzLC186eR1JZnUQmDIm5LCYJbPD8autrhYSNLrjHqeU1BfX2GgLnG+CYZ0x82TajU2zGDIPqO+GxCshV0zBRqrtrDzUe/TskyFSo7zA/ZmJ3ItrIqdyjb1TC7taUWs5KEtsiyDIVzB6CMkMYIIFf0G5VjO0GpHqKTlFW4Hmv4fDMsEvLMGiwKZuwvb/dS+r0Y1VM/C0+moB88CEs3vS3TlnKXaCVzeTHOr8ve3+eIiPiwV7wAPBGDQlXDEXTtjBPdDXyuWyKJpvWF+lL2jm7RooWFNGocaEfyaLmqGjw00KOmT6XY+rk9zDQAmph5yhVQCuu9G2vnmlsH9aGyUASV2vEO7wUvXaXPNXIrKCxV6wcsiE35ZjyayrFtFPHoMEOb5wuW8OZXqR72ETxOn0CpgukspCZd86kPX7lfD7p1gHrNO+xPMb+qQrjds p4Ompkti dZ00eqMKSyqIJoQsChc1mDXkxafB/c+Gh+7lNaUQARnm9xi+uTLiRbFZ3xQe3gcDGu54g7Jr9e7UJTYbYJ5zdydUc0UOSl9yi2y66hhfmTFRVnO9/wcqFNMyUA05RMDbdLjbvroJ7ZE858wU6bPUB48GxR2SuJYSCYcfnCUnq7UH5jSL7ITF1FzP/gdbZz2k/s45kFh/FFRkVGHiRlMPIg+t+8+0dV3GIKsTs3lduLNdy7GmlrvU87P3O63MvhdnEvEKEMtyoWW4aehSjsveyhZwTi81wpmCiQgHK+HRZZHBYTlHwYEGMLHGlEln64OQQxE68PZBeyDpt071uuAPvz9AflLEdQJKo/cHydldFutt1OP0V1aT3ON8pVk0eM5VRXwerl9VL7vonCw7ra5nIwY2ovO1oVAbQ5iqx 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 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