Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp629321rwb; Fri, 23 Sep 2022 01:48:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM463IFyTXoZdzuh5zLYkFmTaOibQUUTwCA1iI26gsMqacNr4RhAIoysq1npiQEoLt9JsSho X-Received: by 2002:a17:906:9b86:b0:73d:72cf:72af with SMTP id dd6-20020a1709069b8600b0073d72cf72afmr6004781ejc.440.1663922902280; Fri, 23 Sep 2022 01:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663922902; cv=none; d=google.com; s=arc-20160816; b=ubcmeHU7hOixfF8NBTX7UbsqgvkNLZfr9kdidhC+kd/CuzxGRg4nIlf/FRRejOsmf+ k4q2utMqrLgmqIBWTP5WXQyVzz+BkfSZa1FMpRArbvbA+bm5OVze7ZGtNpkuzQf3mK8n 2QJthK/0Z3UKf2f4/KQZoAc2CxOZ5hc7IGCZuxIadPxXx5KTc2LqO8/4aZ2R5kmnsVgz GpIdjV9AgngVbFtbiYPkfr6uys2Jj+WAgwt5qDC6wNJ2i2F6dUyhZw6T43NFEMD1uE8p 4YsK9a4VWhPAXqbfpN91aLUt+TaDZ1Ev0NYgA9UKyYY4ScwKRysq7KfpXK6AgQyV3LvP fa5Q== 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=V1rRq3lqNoW5TcE/xufv462Ekykzam6103C+3ht2Ez0=; b=uHRUfjnjWtQaSEiy9sRMPXHei/8W8Q8sYu4YHR9HS3UWyBNNnmIWHq5vs/027sVHYL 4zcrt5JO+gkvoVoVv3dPohdSeUzMupRZ7+WFMtIJ9N81dAXnbHQXaVg1+fn5bmHjoJbN +fnmeLoke6gQn9SDj0yNQK44gA+ccfNDWzN+5srEcSgoOE+6cxhlpydT1B4HWkuYq55m vzCXBd+Zq0a3mv4F91fE22L2zm3eBe5cgtrpYpxwdoNz+axDQ8RGHtV16jJdgXcRk6zY W5Z42O0/3npHu2i/uyoaeGSVD2IFMI1tCVCupoUWgKbvDwkS2DDnYU7I4jEZ2cotgwLD Q6UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=nJejs3bR; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z21-20020a05640240d500b0045107d5e6f6si9303724edb.162.2022.09.23.01.47.49; Fri, 23 Sep 2022 01:48:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@infradead.org header.s=bombadil.20210309 header.b=nJejs3bR; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbiIWIjr (ORCPT + 99 others); Fri, 23 Sep 2022 04:39:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbiIWIjq (ORCPT ); Fri, 23 Sep 2022 04:39:46 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E44D82C669; Fri, 23 Sep 2022 01:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=V1rRq3lqNoW5TcE/xufv462Ekykzam6103C+3ht2Ez0=; b=nJejs3bRso0/zXedtRupWJU72A D3mRvV1bNdE2jDqNQcPlaka+ZwzpBWGS5HALHhg96r/Xp9OkKYfxPZYX4J3P+AbEbEuE2fbiu5w2q OswO4Rg7IAV6ekjzj5XIhzHzkgwzwTDKamCK8uJ1uCrwR//u5idtB2/UT1b11j2E7/5jb61SIPgEt fMKj4ZhqXR7WVWpg8ZeafRMkrxjAbjvm21zfVvJTbzz1AsoVx7wjyA79kn1mhGhQPBjPgOEOc4tKM kOVN+tMXAAJ30PeiPypcGFxGeX+CNxeYmzxe6HJiJe6T7SD4E1F1E45QfBGkRMXYGwstHf7BwLD7F Oa6WIohQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1obeDT-0030o0-Un; Fri, 23 Sep 2022 08:39:23 +0000 Date: Fri, 23 Sep 2022 01:39:23 -0700 From: Christoph Hellwig To: John Hubbard Cc: Al Viro , Jan Kara , Christoph Hellwig , Andrew Morton , Jens Axboe , Miklos Szeredi , "Darrick J . Wong" , Trond Myklebust , Anna Schumaker , David Hildenbrand , Logan Gunthorpe , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH v2 4/7] iov_iter: new iov_iter_pin_pages*() routines Message-ID: References: <20220914145233.cyeljaku4egeu4x2@quack3> <20220915081625.6a72nza6yq4l5etp@quack3> <20220922112935.pep45vfqfw5766gq@quack3> <7e652ba4-8b03-59e0-a9ef-1118c4bbd492@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e652ba4-8b03-59e0-a9ef-1118c4bbd492@nvidia.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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-nfs@vger.kernel.org On Thu, Sep 22, 2022 at 09:05:16PM -0700, John Hubbard wrote: > I certainly hope not. And in fact, we should really just say that that's > a rule: the whole time the page is pinned, it simply must remain dirty > and writable, at least with the way things are right now. Yes, if we can stick to that rule and make sure shared pagecache is never dirtied through get_user_pags anywhere that will allow us to fix a lot of mess > To fix those cases, IIUC, the answer is: you must make the page dirty > properly, with page_mkwrite(), not just with set_page_dirty_lock(). And > that has to be done probably a lot earlier, for reasons that I'm still > vague on. But perhaps right after pinning the page. (Assuming that we > hold off writeback while the page is pinned.) I think we need to hold off the writeback for it to work properly. The big question is, is if there are callers that do expect data to be written back on mappings that are longterm pinned. RDMA or vfio would come to mind.