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 EE261C77B7F for ; Wed, 17 May 2023 07:40:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E35D280001; Wed, 17 May 2023 03:40:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 692DD900003; Wed, 17 May 2023 03:40:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 533FC280001; Wed, 17 May 2023 03:40:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 441FF900003 for ; Wed, 17 May 2023 03:40:33 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 143394043C for ; Wed, 17 May 2023 07:40:33 +0000 (UTC) X-FDA: 80798949546.24.B8815C9 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by imf24.hostedemail.com (Postfix) with ESMTP id 3618C18000D for ; Wed, 17 May 2023 07:40:29 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=WA4SxHpv; spf=pass (imf24.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=lstoakes@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684309230; 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=E+Ld0Ovjdd0x8sc5pvboMnhYHV4AgRb0J8CE6t0hZIM=; b=G8S/j8qDoFtQLYoFx7NhqQglDssrdRPLmaOtmWfIvGKmdUDyigjpDBXT4smGnVD0gc9C+F w3RBRpURWGzVETPubz5xJYXPnQdxZ/TxIKLb8SceN/WuEsoM1pGBfVt5DRtlW28YCPH4uw bboYSDf5I7ETilqMKL9SdA86AtO3uu0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684309230; a=rsa-sha256; cv=none; b=WlHEYcvuE23QhkW0tMM9inUSJXzP51y4qSmxSBhOPgeQC1V4dcVEqcbr8M9+qhRGW9+rwK dfedXO55lI8W7P+6Cs9ITGdMFiWbBvsiwKqQDxMd3YbTvac7+bPk53W+wM0cSOOqYZBMX4 lUbLmlnRg3oQwPXib93x2POcVGKA1sE= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=WA4SxHpv; spf=pass (imf24.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=lstoakes@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-3f417ea5252so2940945e9.0 for ; Wed, 17 May 2023 00:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684309228; x=1686901228; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=E+Ld0Ovjdd0x8sc5pvboMnhYHV4AgRb0J8CE6t0hZIM=; b=WA4SxHpvGm1ODLM4q/8vfu4vKglP08hu0HlJ/yJJbiD9LBzuIHlUgDdcL3VIMkHk/P p2cz2vdAYv4BbiJ0LQb/Dzae+iABrn+JRnv+S8RGWEPseRZq0h7QRvRtmRbcesxue8a/ BciE7NdBJ4QRsjKDJQE77K2/2QUXnqDpqCLLflQ9zc8BaBcSESiHiDelcdo0LrzKMHaC GUMDcQgWV//4Zs7KXkfDnbCoP76vQ+YQT8YhKjLXhfDZACBifHxeO2/8ymyh0cmWzSVD rtYLl1O47U9VzqLqtCwhyHFUA2ZAtik0+iGN7RqiL3HAYiJJoJPkrJkPKRposqrQ0oAq ri2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684309228; x=1686901228; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=E+Ld0Ovjdd0x8sc5pvboMnhYHV4AgRb0J8CE6t0hZIM=; b=YWAmpD79DckH3Fr7iKRKOgA5QqK9DZnSLyrVUOulpBBnV6ltrFeqJa0r9mxyT624R7 d+0eMfRQqNte2dXcQAl/vpDlQ29pTFuNgXKFrRbwXCDT+tcW/oaPaC0N7LXUu3XtMXsj 78Np1XmZmuxD8Z4kmuXmxCzXUxL4RU53zP6boQjbKpyyFMP8S65+XLlFAL7SvYbhxmS8 DUOrUVbnJU/Uo6D6B2n3qjzUZm7NaY7Ozckr9g9THJZOChutkiy0owHd2bkOSDnfz4Ec gWfMh5CzJ6aXuG2tW0z564e5Z7KUxh4Dbld3gAI1mLzVGLorTSOi30uWXMpX8K1vb1Hf 8kFA== X-Gm-Message-State: AC+VfDyFGi+EVlI0WwP+2Gv6LkYWYG23whJZ/wDsdLBgj7yFBQuuA4Uc yURbTIKdqxT469Ith8+dNr0= X-Google-Smtp-Source: ACHHUZ4QFru10EJHOkrAg2WS7xokWnRh6SsO8/nZ9408Z1x44sx4+q5GoeByQVkYGCmWKPQ44It+Qw== X-Received: by 2002:a7b:ca51:0:b0:3f4:2148:e8e5 with SMTP id m17-20020a7bca51000000b003f42148e8e5mr24473724wml.1.1684309228284; Wed, 17 May 2023 00:40:28 -0700 (PDT) Received: from localhost (host86-156-84-164.range86-156.btcentralplus.com. [86.156.84.164]) by smtp.gmail.com with ESMTPSA id f21-20020a7bcc15000000b003f31d44f0cbsm1289563wmh.29.2023.05.17.00.40.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 May 2023 00:40:26 -0700 (PDT) Date: Wed, 17 May 2023 08:40:26 +0100 From: Lorenzo Stoakes To: Jan Kara 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 , 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: References: <20230515110315.uqifqgqkzcrrrubv@box.shutemov.name> <7f6dbe36-88f2-468e-83c1-c97e666d8317@lucifer.local> <20230517072920.bfs7gfo4whdmi6ay@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230517072920.bfs7gfo4whdmi6ay@quack3> X-Stat-Signature: 5fhqa5gtm4gdrg8souomn8d9wtta1wsu X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 3618C18000D X-Rspam-User: X-HE-Tag: 1684309229-217733 X-HE-Meta: U2Fsd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9I10+minvgKAGdit2cFtKiQQKlsqcRjc598TC6e1Ycwl2mtJvl2gZLw4XkYDPZHBvqOmmwHW+Qmd0fSDO2AOv4EM4QbXzrcMkXSgXIhjl5dhwThq/cxaxnMYD9StcQnb82SzEbxc66GjILaP04oQugPih3LAuQrARxSaSmKL+8EM9KZMMdH5TzKXrNU3oiMzf1lw9AqTbpCXggU1L9opD3oYoS6dehH77TKz+UStg5cbQdf9QH7iC3al2w5qDluvum7RY+LNzMBXD/1Wue294it8AgWrV7PZJLhjw0umY+l5DCoYYLKzNWKumxsrYcyxr7Lcft0M9YPg4ESa2pbHkVYDDBCXCbnz7/sQ5xef2/taNr40F0wwoayn90oqjhY1z7FjjHAEDSQxcwuLvS+dLCUCOAV7f1iE3b15wwKEX+sCS1Rpo= 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 Wed, May 17, 2023 at 09:29:20AM +0200, Jan Kara wrote: > 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. > Totally understandable. It's unfortunately I feel a case of something we should simply not have allowed. > > > 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. I mean to say *_ops allow a lot of flexibility in how things are handled. Certainly checksumming is a great example but in theory an arbitrary filesystem could be doing, well, anything and always assuming that only userland mappings should be modifying the underlying data. > > Honza > -- > Jan Kara > SUSE Labs, CR