Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1772946rwd; Wed, 17 May 2023 00:50:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6P6J54B2l4PHjGJ7WiBtmkI3w2ec/oactbRPAt1ukvScvO/g/iuePq11Hh9J9aWWJJEKZk X-Received: by 2002:a17:902:a988:b0:1ac:aedf:2222 with SMTP id bh8-20020a170902a98800b001acaedf2222mr25097772plb.3.1684309807885; Wed, 17 May 2023 00:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684309807; cv=none; d=google.com; s=arc-20160816; b=DrhHlYoIg3PQ9ohc7RwdPe2NKsHrKGKR2zBANxpn+Uu315B7XQLWLXNBy6ET1dCcVq TTgE5/MfujXxpwa8mrvFTxwAV8ACtgk2NNvWMnAIS6wy3Shze1gTZEuQchlmogvl7IPC HmFyYSFSGMM/WF1xGKJfod0RiSFEhgMF3nyESzTLaM2hP20woKBsBAS2zctFeWYhxWkG m2xcvOCxrpn9Y5KSyFFEt6yQCyMfKt3ryCj3E3afN5EG1dg0xMXFRC5kvJz2MMbClzLv tOSfv5jRIq3hpMY/UWpIV02UtYxUF8JS3fpxb+tXkjYnlLTX+/zq4n2RhV12LPAep66L 57Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=E+Ld0Ovjdd0x8sc5pvboMnhYHV4AgRb0J8CE6t0hZIM=; b=jMCIknI51HsM0VduYk2tCx3mzFil+EY5Za9PeZVRv3eUizhQKmCmTEyR+0X5iNNo/1 FpY1IRh3aoazCCeaJbu2JibDJX350clP1s9hSUlpte3DmWCPVTqPeZa1942w6i9kpf5B oPw3EOpxLyEZAYe+Yc0mW2c5i4J0pzXM5pxQzuGeSs8plLRYV/GvA+cgMcMy85MNwO3N 46Jo+IhimUjj52vcp++4rpHT/4zzBzdllQhSttuXXUfJY/eRYZOR+EDACKwMtrFJIxHU y5PwP+QdoQmodISo+OZIe3BA30AZdUhuFQ5G/XGy7GTP/boL24hQCjn8cLA5FPaHrQGo nXiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=WA4SxHpv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a170902d4c400b001a0039e3597si21747842plg.316.2023.05.17.00.49.53; Wed, 17 May 2023 00:50:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=WA4SxHpv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbjEQHkd (ORCPT + 99 others); Wed, 17 May 2023 03:40:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjEQHkb (ORCPT ); Wed, 17 May 2023 03:40:31 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 282DEE40; Wed, 17 May 2023 00:40:30 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f475366514so2821145e9.2; Wed, 17 May 2023 00:40:30 -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=QBzK6v89W+4YM359n67GZzi+5YcIKdg7P+DhjZdk6BTwR0TrW1FmmOP0evHZQ+GOF+ d1GIQP/6NC+glSm7PukqP/G5LTX0bYHVO8f4Mofk5hwC1zTEuc73RJTilFtkf4cyQ7sj XMWBqDzCQPeZHW8L0kDqExExznLNDS9LoWfsh5rAwtRgIZ5FF7mgNQmbIMf4kHhjJWNo +kmRAOmXUJos7QS/BLTrYCyQmhijGqL+GFBUX8ZNp1w4n6jIRAoIZArrsrdxOssv/cER KcGlDUNdAikMEUcszJV6xB0b1x0Z+hEcl4K8JZWotXzl72dlZ+VZo06n6EiKfmsWoxun u6IQ== X-Gm-Message-State: AC+VfDwlygc1sGiQEVkQkU9xynPdCP2yY767H+8AOqjbvnjetIrFM2+T N6GNfcPk8CKGwHWMP0oPItc= 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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