Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4012905rwb; Tue, 6 Sep 2022 00:44:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR5L6fZn7M3oiawlhXAjI0Lfe7fm84hQAoBbTiwnANaRDIfjKcxxSJHrsoVnpPfXTZuy5+mA X-Received: by 2002:a17:90a:428a:b0:1fb:87bf:89c with SMTP id p10-20020a17090a428a00b001fb87bf089cmr23042211pjg.20.1662450259890; Tue, 06 Sep 2022 00:44:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662450259; cv=pass; d=google.com; s=arc-20160816; b=SW9xLTTXHM6dtXybvY3alFuJBy9Ek7E+nV9/Z+zUYaYL5QX9KVKrw89+1EZU7oHcXo b9yuiD1nb1kXP0CLpJt5BHsFsmrhsbFqmWWrW04F0Jx71w5rmCzk2htdT3iYfi6JHjPy zNrZoxHCLYTzLM5//2QzodgS5N1Qwy5mh2aePSGpzVd6VDLWDaSczeRJTlr8vc+urOk0 IqIyp2MmNVkAj1cKCI9VniVdioUnJh2Gy7+yn/eaf9HScEQEgUvEMDf8jcVjgARhMrNL 8/OPkxxvn5SrCkxeTmiTHHU3mkdwJxvd9vAmAMNtkmtzNrFzKAqCXJKBfx2WL3Lp7pQ9 EwWA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=2LEGvpK0ZL/eY/Q4OL7VLZrqeKVgWSCorY+0K5iaJ4Y=; b=kfISIp0b6SUnGeD16bmrIwQcL0uAywkEPKonKULZxDug1g/Bxcsa3+vxbkBdiKQxRS quYOxDNhKhjxHwNMzyx7mKsoT9kxWsDTcbf1Ee8xRbbW+LIzXZamdHslJ9yMbbZeL4UX 48Och1qXz+e1o/RztAh45u8yhUuFpQEkrL3wH/i3uKo2Wk8eaSenvXy+WZdRaKlOjdG8 b4t6sskRNysIlnJgnnxdZBWtOeQj8PXyA97iUd7ad6zwD9PyEtqEdAIu5imjBpzkk0R2 S3n/dbg/wEFyfdEsbVogg7DAp5Xu/qRAtGQTQz+OI7MAmgAZG2XezuZ1ds05o/KzSUSY 9eAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=Yie4tFZN; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t127-20020a625f85000000b005303194bf1bsi12132911pfb.111.2022.09.06.00.44.07; Tue, 06 Sep 2022 00:44:19 -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=@Nvidia.com header.s=selector2 header.b=Yie4tFZN; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238942AbiIFHhH (ORCPT + 99 others); Tue, 6 Sep 2022 03:37:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238921AbiIFHhG (ORCPT ); Tue, 6 Sep 2022 03:37:06 -0400 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2073.outbound.protection.outlook.com [40.107.237.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58F6A13DDE; Tue, 6 Sep 2022 00:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NFXD7YtK4k9GSNTIrGtCt5dwLjfNfyTjMol15DxfpAOvxibHMnUx4Ll1OQ6kKAcVfYal7GKQAr1JSxwpRESlga+c5UHMnVd8i2JiKBJP57kU0ihVeSrMAp8GdrIFUxcWnpkZ3WXs0n7RUPpvVL3zx2gk3yjLGAPgTrLYBXeIkntDq2AUZLIvlRZLbRtGgZy72KprK02OZK4LPxbPkR18h0sv2e2HFiuDd8sFZeGIIe9t5oc2+uxBLNxsisqEP2UA15OrqTjhlE7Cx1pZMvSmgKkYKND9cDAGsKb6djS1rFaPs3kbc5tZkGOMGsA7S9MJ+PziSSgvN4H/jRNjSw+spA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2LEGvpK0ZL/eY/Q4OL7VLZrqeKVgWSCorY+0K5iaJ4Y=; b=giTGmYak0QmFvVTmh21hZUKyyuEJH6UtZswimYVHOdW6DLqfatCiXFjBjl8ulQ0HbshLTjIV0eSGOTPTwjqBWvnt1iYMs5SrrWcPjPvkLIHKo3wjk8k8GDl6HHZrcZQpwA2bOVYEANrMIrpDpPu0/gpE9j7B8djO2NkyrOEuDwoUYCHttXcNDQUgdgy3w+7U64biyNBMoXJnYWX/spG/BoXzZnAgJaRXIXqc1p1mEoLd9Inx1KoXiK/exqsQ6G9T9xemU8dZtEk7K9ucppUK5tQQLeCuIVlh5Wf3CgaWH48HtQJk0leymUQT4QkiLUBekDWrPdygNWN/gcFdUa0y+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2LEGvpK0ZL/eY/Q4OL7VLZrqeKVgWSCorY+0K5iaJ4Y=; b=Yie4tFZN24LzEd7JgMarDdaG8BNl4RUZqDPznKEZHVLoOB1DTRS/hhhxHDM5rLiivaKlPnBsTBT5+rCJHEUCFMrYEAC6evZluy6MSwDIOXS5qzw3WjNbyLAPzrjLkqJy3+Ddr3fUFycHweXXNylbA6ciO/Q1TnZXokAlMvbaR3NRP98VNbcEphqtrcKKKpigtcRjIybmZVZWQwM4THsxUAWm0r7Bb2YhcEFC17fQ29KwGQbuEyePNgmGvic5tWO0PWScilm5FV4V6iBmqHLrVctfBXlddsgkSrCFTGbEaP4tiLzeQvyc+/FYfuI8nQ21zWCq7i2FdmvjwftH/cZ4sg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4140.namprd12.prod.outlook.com (2603:10b6:5:221::13) by BL1PR12MB5995.namprd12.prod.outlook.com (2603:10b6:208:39b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.17; Tue, 6 Sep 2022 07:37:03 +0000 Received: from DM6PR12MB4140.namprd12.prod.outlook.com ([fe80::e0c5:bb15:a743:7ddb]) by DM6PR12MB4140.namprd12.prod.outlook.com ([fe80::e0c5:bb15:a743:7ddb%3]) with mapi id 15.20.5588.018; Tue, 6 Sep 2022 07:37:03 +0000 Message-ID: Date: Tue, 6 Sep 2022 00:37:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v2 0/7] convert most filesystems to pin_user_pages_fast() Content-Language: en-US To: Christoph Hellwig Cc: 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 References: <20220831041843.973026-1-jhubbard@nvidia.com> <50d1d649-cb41-3031-c459-bbd38295c619@nvidia.com> From: John Hubbard In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR05CA0085.namprd05.prod.outlook.com (2603:10b6:a03:332::30) To DM6PR12MB4140.namprd12.prod.outlook.com (2603:10b6:5:221::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e4cfde54-9b18-4fc6-3dbc-08da8fda97ac X-MS-TrafficTypeDiagnostic: BL1PR12MB5995:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Kf1olUJDmsWeast3hnaIFbuiM9blQDSBdq2G09hfYr14MEyfef6cxBUj7A7FRVQdm3V3AR6XI2Qu/JUQQCgvFfrarUmD/2KNaX0QiYzVg6HNmAwJ8AK2/+HmcHUsoJxO7KdxXkj80UfdMsjexuc9lFDkKCX2yf9lKrcb2gPTKk8sH5KckkRYBxXClXw1fM31Eaz9PJS+KesmsT5virOkyB+kUofaRcRN7VZK6wsrSDUj6DN7DXN5MxhJSVRjWQnJSsTJu4aPGJoBxXNJe/rSA6YntHT4ppgwNcJlea3WdT4GdlRQxpw5ikP+XAeb7HKv2MOXxdweG2wmUaOMsq2HApfW6Ni4ivxEWLMLAv2Dsofzs7Jn6Fe7sPkiKg/4V9yrevjPSLU3ks8ne90cnjggvp8EkHKJhxr+PfmPXzKXOYfDEy8TX5wPQPVUbVAZPlRtk8t6Hx3te9YgecepeVtpWpQ6KLhixWrOoFlJg9ISDJUXTmcvpjPB1tIfK7KCsiqXw+QeKlZtWcys4ZOiAB0heGjRCU6qI4pF8SsB1LG3A2Jme+82e1e6M93EAs3JTaeTpB7PiZ7jjDbj/JNVDdlN+M0ciG4VqmfaKnzyVkVC08LFYnRoKC0s6fUhV0OTEeCTMQNNfw71A2XWzmgt611EJMOuyEwwyLOPnMEi0x+AG4bL85Gd3Xo2Yuy58u00OrOmQRFSr81JE6Aw1qzHKdhHcQPagEFJxIvKEIKtuO2Colx2ASVyo5l7WQv+EtwQL2SjM43e0vzo5irASD81zGiXfENz9nnhiqmB0KDMDAcXAuE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4140.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(376002)(136003)(366004)(39860400002)(396003)(31686004)(86362001)(66556008)(4326008)(8676002)(66476007)(66946007)(36756003)(38100700002)(31696002)(6486002)(26005)(53546011)(478600001)(6506007)(41300700001)(83380400001)(316002)(54906003)(6916009)(6512007)(2906002)(186003)(2616005)(5660300002)(8936002)(7416002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N0Z6TlVPVkdvYllJbVZGa0JKaHlBYitsZlVwclZEYm5NTmhZR0QxMEYrRm5W?= =?utf-8?B?YkczVkVMSzlaV3BCVmdudFFCWVg5c3Byb0JnTzRkaFd3a041NWNPRG44Nm42?= =?utf-8?B?RDE1Yzg0d2hDNWFKdjUwY1RwUDFQcHhzWmZNVjU0c1p1L0N2d1ZRdklncUZv?= =?utf-8?B?NUVQUTlNa3NGRDBETWdsYlNpd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Sy9jLzk2TlZlSG1LV2pvcmlQK0tGc0l1RnFENm1YamVvM1BQTzVwM1NHTmZD?= =?utf-8?B?aG84Z3NKVjg0UmJNazFQaHExT2pPdXI1bzdiOVEyVjA3VFp5b00yWjZ5TmtG?= =?utf-8?Q?Sh+uuVbSrIjZuCyYz3aqJNxKd?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4cfde54-9b18-4fc6-3dbc-08da8fda97ac X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4140.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2022 07:37:03.8199 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qi9QjPN6NZsEzMSsdY/k335XkAEXnmeJ02G7Cmr7fBq/GMWXHMOsh6zXsv93KtTOXp8KDxuC2yUirQjCzDFzYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5995 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, 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 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(). $ git grep -nw bio_release_pages block/bio.c:1474: bio_release_pages(bio, true); block/bio.c:1490: bio_release_pages(bio, false); block/blk-map.c:308: bio_release_pages(bio, false); block/blk-map.c:610: bio_release_pages(bio, bio_data_dir(bio) == READ); block/fops.c:99: bio_release_pages(&bio, should_dirty); block/fops.c:165: bio_release_pages(bio, false); block/fops.c:289: bio_release_pages(bio, false); fs/direct-io.c:510: bio_release_pages(bio, should_dirty); fs/iomap/direct-io.c:185: bio_release_pages(bio, false); fs/zonefs/super.c:793: bio_release_pages(bio, false); And these can probably be done in groups, not as one big patch--your other email also asked to break them up into block, iomap, and legacy. That would be nice, I really hate the ugly dio_w*() wrappers, thanks for this help. :) thanks, -- John Hubbard NVIDIA