Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1820119rwe; Sat, 27 Aug 2022 18:38:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR5l4yQkhBzRnhoDUG1Y9fXJKxIBR+6Y8Ecc/i8Ivmhas+cXsuantZegp+l1iGVNzCUUofHq X-Received: by 2002:a05:6a00:234f:b0:525:1f7c:f2bf with SMTP id j15-20020a056a00234f00b005251f7cf2bfmr10636534pfj.14.1661650711066; Sat, 27 Aug 2022 18:38:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1661650711; cv=pass; d=google.com; s=arc-20160816; b=ZsYSJffB3XMasfAJPIg4slqWIi/PnPe+ppGqwNVjHsbHYB4onQKDnB1dtIOHYollqY qeGy/cPxg6Afa57yBgPTdsqfHMfzPVFcHNJvU6881l0cnBetbeuT3FE9p6Flvg4VEw4Q YRpcTxx8VBnhNiWAe7nDx6/MogZuMsNqXlEW1y6/MY5dbA7gGwZFcCfgULw5RALuXf59 wCDlOR/lM3Ob4JNxvFv4lsQFDBw+HSJCzAwLj0IvPy52Pu5dufjinxJ+ZrQ+fwcwF3gH Q6Mhdv0iElqcR4Cb6AMINt7yOwZlTfqTKNxZavY0ykSTiK3tzlPF4AeYp1KP6jkz/U8B Hd4A== 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:references:cc:to:from:content-language:subject :user-agent:date:message-id:dkim-signature; bh=0qgFoj4aoFtoa7ImsVC3+YHUj8ufhx8X74LkpWSUDRQ=; b=tElxHX6EYyZ6JagwvQ6+Dm1w5m1eI7GMJ+vS7BAO666H5ck3GNYPdT2U5Fc3C2jY5I xcAcoDquYPmUaoqCqYX6x5Q9bE3I66+T16m6W7/On16uwtxeMHVrAGPlnpgQQ+rGdO9G /8DkzxrhCzamU8zPTfc7/QT4dIImIHqbrboDUX4qHy2XHAMyXud9j1+5qASusnWC5/Iy YxvwYu0LWDc82aUw2UkQSFGpWJKNF4XVh59lCAQPRd/Z0midg2IF9J+lVIrrOfV0ksu5 xoLctz6K+HUiHxsrW4R5CFcgvlCMkeNxabm4aW2/558kfkyPlcB6o6AKI9BzlLWvCnhq UY6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=clQxFgS5; 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 r8-20020a170902be0800b0016c39c15fb9si2475774pls.201.2022.08.27.18.38.06; Sat, 27 Aug 2022 18:38:31 -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=clQxFgS5; 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 S230201AbiH1BH4 (ORCPT + 99 others); Sat, 27 Aug 2022 21:07:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiH1BHz (ORCPT ); Sat, 27 Aug 2022 21:07:55 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 430F04D81F; Sat, 27 Aug 2022 18:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RarSH45MZT6jfFcdNdewAu5lGJfJnsreF8Vx/4RiYC7rIHxGEg6MbZa3mG8whJy4zzpCTiAXi9QdO0HwLajtc1E8wHgKE4RwMRUEnlM0RwFWOAH4W6sVIOfp2gLgTcVFUIuKNz21Z5QUFO0VVQHKGg1/G03dxm5ggjT4ZN8hqceUrjn4zesqhuoqRE8QF4JHxcF9VJxEumlnjEHjOvdnDua98Ni7y4WNXvHNmhzptb728xfBdJKIVYiBmrj1jqYOT0OYp+nVg70R0zgL5xiimVq/TwIJORZZaC3JVahQ6Z4h38Tc/mtMIkoqX82r9QNsCqTE6FZzk8b5DjnaivqO1g== 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=0qgFoj4aoFtoa7ImsVC3+YHUj8ufhx8X74LkpWSUDRQ=; b=WQlVbzdQD6Tsc4ez7L3UdmpEMntcB1viI9/kH4HlqFku+wKfc3BX/Ktl+K/iRKXdcpUEeNmDM7Yv7VuygeyuQyuuCBB1zfRlIBZ0rFe2FOZJMeGFxOeMT3Myx1YeaIOwhvjcuYp+e7pdna6Ybmq2Cyz6wX1uwc8CG5VDlTA9LBxujoAubeGFGuXMGC+b4A+stn9ErkYlh3nwP+rw/IgxUG8zUYJ0pAZJ2eosKSB2uHfsNopGYqxAqOxv8iMwaSwRBgzUOsjAPU6gYOZ4TCuEyZfWHax9CccKNcWfb5p3J7uywPhT/eNizzUf8h3lQl5eA4RZ9fsIacGvFz97hKnKlw== 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=0qgFoj4aoFtoa7ImsVC3+YHUj8ufhx8X74LkpWSUDRQ=; b=clQxFgS58D46dgU8cpSQ/adv5LP0eZset33/lyKPvm8hs5mEs4VkFP6B5EenYC6ibjZJJ5/CNB4Yf+sF9S84l6p2Wa9GTx+lTkIEWNkFE+S9Rzry6+Dyq1BXgoKIX85iXUhGw9jZY7MozUfFCWcNchA+SVDPpyKBnQzdY+MZKM/pDP+KbZNAHbqBhyBmJ/N1L9FlTBFZqaPGwst7jTHeHn0IHJ5um2fQCJjljohrDq3Fhulo4QfixVDyFguGWlcBHyOi9gbLJy8a3KaH1q+odt9sopaAqP+IsiOigkZSWhHtz60oGrQaod/N2A/O9fZQ0KZzMAdfpa0wZD1YRQIyNQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by DM6PR12MB4779.namprd12.prod.outlook.com (2603:10b6:5:172::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14; Sun, 28 Aug 2022 01:07:51 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::508d:221c:9c9e:e1a5]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::508d:221c:9c9e:e1a5%8]) with mapi id 15.20.5566.021; Sun, 28 Aug 2022 01:07:51 +0000 Message-ID: <345f3293-51fd-1f2c-9d6a-7e6e8950102d@nvidia.com> Date: Sat, 27 Aug 2022 18:07:48 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 2/6] block: add dio_w_*() wrappers for pin, unpin user pages Content-Language: en-US From: John Hubbard To: Andrew Morton Cc: Jens Axboe , Alexander Viro , Miklos Szeredi , Christoph Hellwig , "Darrick J . Wong" , Trond Myklebust , Anna Schumaker , Jan Kara , 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: <20220827083607.2345453-1-jhubbard@nvidia.com> <20220827083607.2345453-3-jhubbard@nvidia.com> <20220827152745.3dcd05e98b3a4383af650a72@linux-foundation.org> <4c6903d4-0612-5097-0005-4a9420890826@nvidia.com> <20220827171220.fa2f21f6b22c6d3047857381@linux-foundation.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR01CA0071.prod.exchangelabs.com (2603:10b6:a03:94::48) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1507fa3d-c5fc-49ff-41e0-08da8891bada X-MS-TrafficTypeDiagnostic: DM6PR12MB4779:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lck6Pbx24zNPshqLbrNG/SYQIjqneeiiaRT7AHdrYNYcBVRFY3JK5zAoA3nRKk7hjeTMo04YKXhrIOruqlnSZ5Gng7S7iRR8F8uorXPkW25rMjhACeDNplaYWVlfGDMvUkEPhP1GHqYTTcepIPfi5lT3OjcbsZ9PbvkM6Ifivc6AVP4V9FzuWqJeEqn1hXOyXdxE0cPst4r1Qhi2zI7OY9h44vKbS0i7hjefDaA4y/vWJ6yqlDDVZGA6QehxvDxG4x5cElWD5JAElsF12RY2LgB+zqdiBXx/Eul+AX/QCeJFhr0YRzi7BmVCPTPhNKGB3WdlnbE7AVvzocoecBr6+F/zJoGRpB3E3IkrIUI1eJEhTG8rUm/kqJ66Agd/VodVn7SwPxvd/5x3i55yl6so62H0FHAgJs1EDCgrcqKSnT8ZbkwoNnA/HDVxz1DzjzigblVdmBWwLJ1bUvHj3GyPUuystZtjIn9qLEJiVix1FEtlDg/Y6khoq/bGN2bAc+ZepUtk7jRcUP2i/E8aaRptCvR5Z1mdYTUeNH2OTTNnxBkpEFNv4ofRO/OMGbajfkttknBMqz2Ii/up/ynFp7zHrICenvcUgMxXnRo7CBbwb7uSL0JSgUMfVY6y/DG5S+4I4uZkFCPawoTpXqkMKiihBwcmPRk9BaUXSnx00INlSiz0Xaj47+2WuGqm55iTultUFpHCDpjP2OSVxUcouO9DtI6DSmIZofYnnlC7ulX8sRdV2A06pnyaozhtYx3qp4RJTlQKqZ+DldAhQk4G6JCP4TvTeuobTKetFz6ApAPYZcU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(41300700001)(6486002)(6506007)(53546011)(26005)(6666004)(6512007)(316002)(54906003)(6916009)(86362001)(31696002)(478600001)(38100700002)(186003)(2616005)(4744005)(31686004)(7416002)(8936002)(2906002)(5660300002)(36756003)(8676002)(66476007)(66946007)(4326008)(66556008)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NjBHQmpSb1ExWkx0VkdRRENabG9VekZnVVlodnhyc0pxem16cXAwdXRoNjMw?= =?utf-8?B?L090aVI3MWdGQ2JtaDFPOEtRVXcxejZlb2hhRXJpVEp1ZEFvanpI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JXU0NibGVCeDZLb25QamhPM3k5UC8xU25zdDkydU5vbXNv?= =?utf-8?B?cGxxalZRbnVQLzYwMWlKTlhFZ3BxcUtZWnR2aGgvazExbWZGb3JpYlZuaFFj?= =?utf-8?B?OUhxT05sTFlPK2NRTHN0RG5mc0V1bmlKc3N5a1daUlRCdWZyeEZQTTk0VTN0?= =?utf-8?B?UHdsNWdCeFZneUlpaElMa0w5SnN4amRPeVNuTzFUUWlrTkhNTC90ZUdiRUw2?= =?utf-8?Q?uv3zBsq5sDOtAuKRzkXpU5BuA?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1507fa3d-c5fc-49ff-41e0-08da8891bada X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2022 01:07:51.4097 (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: 8pSUopkVYVUGWDefwj8jBPnQR7aQaL0ZsnQpAiwL5O7IhITgUHPipP8vBjnPg+vZ1WldfJ3KHWKglDrfjK+O/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4779 X-Spam-Status: No, score=-1.1 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=no 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 8/27/22 17:31, John Hubbard wrote: > On 8/27/22 17:12, Andrew Morton wrote: >> On Sat, 27 Aug 2022 16:59:32 -0700 John Hubbard wrote: >> >>> Anyway, I'll change my patch locally for now, to this: >>> >>> static inline void dio_w_unpin_user_pages(struct page **pages, >>> unsigned long npages) >>> { >>> /* Careful, release_pages() uses a smaller integer type for npages: */ >>> if (WARN_ON_ONCE(npages > (unsigned long)INT_MAX)) >>> return; >>> >>> release_pages(pages, (int)npages); >>> } >> >> Well, it might be slower. release_pages() has a ton of fluff. >> >> As mentioned, the above might be faster if the pages tend >> to have page_count()==1?? >> > > I don't think we can know the answer to that. This code is called To clarify: I mean, I don't think we can know whether or not these pages usually have page_count()==1. thanks, -- John Hubbard NVIDIA