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 4D912ECAAD8 for ; Fri, 23 Sep 2022 08:39:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8442980009; Fri, 23 Sep 2022 04:39:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7CE0780007; Fri, 23 Sep 2022 04:39:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 66D2880009; Fri, 23 Sep 2022 04:39:48 -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 533EA80007 for ; Fri, 23 Sep 2022 04:39:48 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1C3F1404A9 for ; Fri, 23 Sep 2022 08:39:48 +0000 (UTC) X-FDA: 79942702056.14.86BD8ED Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf30.hostedemail.com (Postfix) with ESMTP id A56C680006 for ; Fri, 23 Sep 2022 08:39:46 +0000 (UTC) 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663922387; 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=V1rRq3lqNoW5TcE/xufv462Ekykzam6103C+3ht2Ez0=; b=IQkSRDEVveLOxIcYaS/COyt8y2aqQXlzeb0PstaBQn84Kz7ZvECb5Qs7Iec/mkTtuhzgvc AMkL29jTdTbCljePTBiRn2XlrYlNUOfJOxry7vly9TFXSPEnNYfn4KXzh5FzfZwyzozh6L x0Q4mGW1eA7HEjjEI779xcCQ7mzpvm0= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=nJejs3bR; dmarc=none; spf=none (imf30.hostedemail.com: domain of BATV+37c89300bb66dcdb041c+6970+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+37c89300bb66dcdb041c+6970+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663922387; a=rsa-sha256; cv=none; b=Cy7EWVhAAeNHJCb+7FHJX0e8AA1Rf9nic29UXaopDZVAuVs9VAHOD3dEV0F6Vv3CiLFnE/ XmtsA9liVVxLOgkKRj/RD6gHbI66cQyf7MmJQWGxWOtA5DKHexO228FNxpkYT/wkhBnufX tD0BI9yLW5nQRQnPVNwwe2ty7jmC4/E= Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=nJejs3bR; dmarc=none; spf=none (imf30.hostedemail.com: domain of BATV+37c89300bb66dcdb041c+6970+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+37c89300bb66dcdb041c+6970+infradead.org+hch@bombadil.srs.infradead.org X-Rspam-User: X-Stat-Signature: un36wo1p8etgcf6qhnsuo4spgbi3mud4 X-Rspamd-Queue-Id: A56C680006 X-Rspamd-Server: rspam06 X-HE-Tag: 1663922386-73546 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 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.