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 88706ECAAA1 for ; Tue, 6 Sep 2022 07:46:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F34B080262; Tue, 6 Sep 2022 03:46:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBD7680224; Tue, 6 Sep 2022 03:46:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D5DCE80262; Tue, 6 Sep 2022 03:46:27 -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 C3E2680224 for ; Tue, 6 Sep 2022 03:46:27 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 96508140689 for ; Tue, 6 Sep 2022 07:46:27 +0000 (UTC) X-FDA: 79880878014.14.04D1063 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf10.hostedemail.com (Postfix) with ESMTP id 8BC74C0069 for ; Tue, 6 Sep 2022 07:46:26 +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=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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662450387; a=rsa-sha256; cv=none; b=THz3aAV5zBeJU7UeNUhwz9Xvepv3EUOYfYjgc7vbx2fMN3SDLk51izpkzLjMZF4v/OAToa AOVrizTfo89mu6OOpnkiuA1G/rDrS8/6JjdluDO/4wXbuBfQC4zh+S79ZHIue6hdncOfMm pYQUaxgeuyn0hyeeXxJ3cgU69vaV2As= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=SCvMLvtl; spf=none (imf10.hostedemail.com: domain of BATV+3c9dadc9e27e1b9c7a6f+6953+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+3c9dadc9e27e1b9c7a6f+6953+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662450387; 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=h9eaPItotJ7UIpRDKaJ9/my+8DVdUgH18U/XWRw9gVo=; b=4oER0hkyPm/+vEJxu9uUiHUHs7lh0MmB+LSFQIWbk2yG0yoDBgNyqGfvk96/qJiEi5PN8D NYRmvt+bieuUp04SKx9uMOCcdFQCfG0vnTSRxle+dG22HVhY+JT0lQiH4Uvqru2bpRMHMS wsSFPMbp0wxxafdIIGhjHSeBnuX7HwM= X-Rspamd-Queue-Id: 8BC74C0069 Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=SCvMLvtl; spf=none (imf10.hostedemail.com: domain of BATV+3c9dadc9e27e1b9c7a6f+6953+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+3c9dadc9e27e1b9c7a6f+6953+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: 8p6zmg3pe1dif7qj5radcg1gety9hmyf X-HE-Tag: 1662450386-462497 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 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.