Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4023104rwb; Tue, 6 Sep 2022 00:57:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ZtwjStSIZ9lFMsZCuJJL+jV1TLUOrjQ9CQRBagPunjYPWRptDcMWiVGD2qxPECBT4QzST X-Received: by 2002:a17:90b:38c6:b0:1f7:35d8:26e2 with SMTP id nn6-20020a17090b38c600b001f735d826e2mr23944131pjb.168.1662451034341; Tue, 06 Sep 2022 00:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662451034; cv=none; d=google.com; s=arc-20160816; b=u/r0WPhFf1/Chv76DeL1Y50amE0/wD58jJu/UqaO7UCbaWYZvz/fLDgQ0e6hQPUCCU Jd8x6Ft4heGrumCaaHU7abulnZBzbey0vu59pY9pkzXPmTFyASs5+nBuv89HwGocD8qN lzP4h63lE3CI8R+sVH+Ob1nwcRw4QMaQt8ZjMyNeMnCPpclmfsi3ThpbRB9pyg6QsHCV 0IVsdR8L3TcShrE78JVWvvQI5EUVbPnT4Zaca92D1SaYkxEkReEfmUH4a30gZMRKmXq7 VERvPTm9q+FYJj0COPYj5zk2VetRhvpQi1mdSfwqS9O+NX777MmSgDzdIP8/yFEgCWnM BQ2w== 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=h9eaPItotJ7UIpRDKaJ9/my+8DVdUgH18U/XWRw9gVo=; b=SuCDNQnTAHR3r0KQTm2yndFEf3XK1d8/EiO0G8nHG1SGnufozC3Fr/Hv5xTWvPvZke 87N+oJ94NPDKClSEcRcDwwFXa+9yXOWJGRu3G6yO9T9DWGcVqSmWL5bsZwEM3zoT/6si P1wdiE43MNl9syj78yU9v7HY4F4qHNaa+QKk5byIWqURkU4lJgcHOeuSAfnAppZVKW3J quhlHPOlxxaxNLwDwClt/SiQbuIbQVTXjM9WsCW58GZxMpiIaICew6ZKFpKDkBoas6Op rpeGvqIg83QBObvfw+oZQ/XNudqQdcqubIXz5DQv34sFryGVVP08AVEzAC8kQ2gYJdNE CnhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=SCvMLvtl; 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 jb15-20020a170903258f00b00176ae70d99csi4941223plb.31.2022.09.06.00.56.59; Tue, 06 Sep 2022 00:57:14 -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=SCvMLvtl; 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 S239012AbiIFHqh (ORCPT + 99 others); Tue, 6 Sep 2022 03:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238970AbiIFHqd (ORCPT ); Tue, 6 Sep 2022 03:46:33 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 289FF6FA37; Tue, 6 Sep 2022 00:46:24 -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=h9eaPItotJ7UIpRDKaJ9/my+8DVdUgH18U/XWRw9gVo=; b=SCvMLvtlCWYzBebXM8+WkKDrjo ymTnnTY52kxYFnUiA7OTVNS90YUq+kTYFgbjNWAuKGJ1QUdWwKQmu/AQlrqji5v3r433FIog5S7GM CTNKqeQaustPu5E1Z2coPLUA1ovGNEALpYvfdIhaKAa1u246QTcS96pf5SR6Mk6ERVk/i1F46Ux48 8yglEbpXh4+GYqEWV2oxHIdfsk3Q0SNZYqjPSe2QnhIY6zTUsDocMzZ7nDFkFnmsuv7dnfrLvHZNv FDWqRXMlHaQmtBt30Vz0Z8RXXV3zY8Y0c7UBJiD110xs5iCZHGkAQijzg3Gn4QCza4UVETpoPvC8m /y4OZTWw==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVTHj-00AuQK-AA; Tue, 06 Sep 2022 07:46:15 +0000 Date: Tue, 6 Sep 2022 00:46:15 -0700 From: Christoph Hellwig To: John Hubbard Cc: Christoph Hellwig , Andrew Morton , Jens Axboe , Alexander Viro , Miklos Szeredi , "Darrick J . Wong" , Trond Myklebust , Anna Schumaker , Jan Kara , 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 0/7] convert most filesystems to pin_user_pages_fast() Message-ID: References: <20220831041843.973026-1-jhubbard@nvidia.com> <50d1d649-cb41-3031-c459-bbd38295c619@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_NONE,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-nfs@vger.kernel.org On Tue, Sep 06, 2022 at 12:37:00AM -0700, John Hubbard wrote: > On 9/6/22 00:22, Christoph Hellwig wrote: > > On Tue, Sep 06, 2022 at 12:10:54AM -0700, John Hubbard wrote: > >> I would be delighted if that were somehow possible. Every time I think > >> it's possible, it has fallen apart. The fact that bio_release_pages() > >> will need to switch over from put_page() to unpin_user_page(), combined > >> with the fact that there are a lot of callers that submit bios, has > >> led me to the current approach. > > > > We can (temporarily) pass the gup flag to bio_release_pages or even > > better add a new bio_unpin_pages helper that undoes the pin side. > > That is: don't try to reuse the old APIs, but ad new ones, just like > > we do on the lower layers. > > OK...so, to confirm: the idea is to convert these callsites (below) to > call a new bio_unpin_pages() routine that does unpin_user_page(). Yeah. And to stay symmetric also a new bio_iov_iter_pin_pages for the pin side.