Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp904353pxb; Tue, 1 Feb 2022 12:51:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwl6a7IxkQ9TGs9uAFMjPmMj0eDQFLZVbQ3ygYz9N9pmLoW75USHL2c/LlIDK3LstDRgQv/ X-Received: by 2002:a17:906:7308:: with SMTP id di8mr22735446ejc.464.1643748678736; Tue, 01 Feb 2022 12:51:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1643748678; cv=pass; d=google.com; s=arc-20160816; b=WinrnPa/eh4PyNvHsWgX4iPnBeFxw0w3c5lo7Iji3AiUnzi1cqODhoki1q0KA/LTMp nZGrPPE3OTKFhAP07iLBlXTNL11bYH3cSR7VU3EZ7+o9jTRA1uvwYCn2xsG72stbpfBU iVm4od75TLlCLDvQMSX52GXlYAGebnLycK5S9rGOVYnKD5suqdqDgZ18gp8ENM30mSR6 BIwcVIQx/lnJ68/qi1Sbfof8i/PiIWUh2RdU/endi6WpX7zlYg2Q96TUJXMAN394nZrS 7tRG7lFNUQJPLVitrh5PhN05a+ejOM4ZcBa3R69vnLygi9xWLUvkZaJIgC8gGk7f6rkZ ajSg== 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=Ih3NzIHi+AP4E0Ho1O8OIWkTVXdfA0WrscFpDCc71I4=; b=Wi8KosXtzyx/Ngvs2MR+bmGgWL9GmYjQfQliLLgTuX+alm7CcZfamHEGLhxKoLucCl BTZN0uyru71OTzwoHxYPG9XoYT7e7LS7UIIvQxplu4EofCg31j/89rtPEQ6UJGxv6ego TN0y0nxY9Ixp+2sdqz3GbXcQCq0I/aI3bWVfwMfXznhg3Z6mlLq9qBqwlnJ5ORbQJgP4 dMGO/43+FRCiY6jf5n2H+rIj0TckmrJsp8X6AgSZWLav12a6OZ35gs1Y+JkTkr//dcs0 LShHKR/4KjyPEtJ6U22p+33U/zJVdSh7MvHxp74I5o+CXlkUVYbsLfRcNZus4i7wxyKK bxOA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=mfg3n2r2; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r29si9817075edx.471.2022.02.01.12.50.53; Tue, 01 Feb 2022 12:51:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=mfg3n2r2; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S1377837AbiAaUB4 (ORCPT + 99 others); Mon, 31 Jan 2022 15:01:56 -0500 Received: from mail-dm6nam08on2083.outbound.protection.outlook.com ([40.107.102.83]:37187 "EHLO NAM04-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235449AbiAaUBz (ORCPT ); Mon, 31 Jan 2022 15:01:55 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hYfsp3AbarO1iaKfj4e77beB49XUXiesmSgPW9ekNFFF4DxfzNCB7EkH8de2i6ksPsYm8fk/uPe8I2IT2+YSZY8qowgVkl/2uwh8CbQjTQ9VjvYA5F/7Ws5riL1JK/UfGj8j06owowhekFsO6G/QXfytVgFQ+56Qc8UaZm5xAo6YexYp3Dq+O3tBlGiHt1uo9b+Ospxa/e85AzNqVvxYu2AVFNzDryq40eF9ddTonb5noBREWBNwR2lv4vqa5SoyblnCqhm+h+XkuSTUHoQtqUmrwfjUOkoqmvybiyyIoYIS52MFzVSWnw5i7uh85/5bmGIbrwe5UunycohgzEmbcg== 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=Ih3NzIHi+AP4E0Ho1O8OIWkTVXdfA0WrscFpDCc71I4=; b=eMAGOImjK+rcdxKOy8JsFtmUc+iW6y/KNvo/+LsN1C6h0uvfDISa27UhbQ8ytoM06/QMxkORCE7WwQrD+Irzea35xqzMcurHTZhA5h/WL+VttlWqDmH6m6NWh7VNq3UifIZOzq2r91AVNX1ZmgHqAAMexV1sxVL2zmnO4FDoNsVqeX9E8d6WX4YoptBemjQBC08YhBGpwIzDEgIF18/OccTMO9E2FO5BjrEjSfw23zWzu0/bQC1GvPUTN0nk+6P7Dvu+nQWS+qpaFK8Fuiq+yLCwhOF3BXTfRHh1smrY3skFT+tDjNFgWkcjwJINTZJha1LZBE4imM/2ZFz1t+PMMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; 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=Ih3NzIHi+AP4E0Ho1O8OIWkTVXdfA0WrscFpDCc71I4=; b=mfg3n2r2WX2tFFRNJ5ZDjWmIWgewzME6XR3xI9k5mgiLNeBb0WVc3FMzqwiRD+VgV/3k0qjaRb75V0cdaWHPzihQvRpV3YHxP83dauRt9lCiaxX09yjrbiv6MQrPAiMmzE32gRDsiStQZWCtIXzRtr5bbzq0NvJH8WPWPzbGJSkXzMwmDXdctnBLDdlFFNqcwU5w5iqzfp40nuTHeQRIrf9sWmXm0VzULtFG+GeJX5y4iaRMzDUkjPZiEPT8e+N2PjLj/ebeF0RDFaL/MZqtNp/M1ufPWjkKlaUe6eOGcswgiQEIflqI9TbI+7SSawZfj2rsz55hXjG36gaK+BTQnA== 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 BYAPR12MB2760.namprd12.prod.outlook.com (2603:10b6:a03:72::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.19; Mon, 31 Jan 2022 20:01:51 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2d75:a464:eaed:5f99]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2d75:a464:eaed:5f99%7]) with mapi id 15.20.4930.022; Mon, 31 Jan 2022 20:01:51 +0000 Message-ID: <37484a02-9e64-ea20-314a-a65759b138d2@nvidia.com> Date: Mon, 31 Jan 2022 12:01:48 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 4/4] mm/gup: remove get_user_pages_locked() Content-Language: en-US To: Jan Kara Cc: Andrew Morton , Peter Xu , Jason Gunthorpe , Claudio Imbrenda , "Kirill A . Shutemov" , Alex Williamson , Andrea Arcangeli , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , LKML , linux-mm@kvack.org References: <20220131051752.447699-1-jhubbard@nvidia.com> <20220131051752.447699-5-jhubbard@nvidia.com> <20220131120557.rwde6sphc245pzu7@quack3.lan> From: John Hubbard In-Reply-To: <20220131120557.rwde6sphc245pzu7@quack3.lan> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR03CA0122.namprd03.prod.outlook.com (2603:10b6:a03:33c::7) 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: f3ceefae-4086-4e86-e262-08d9e4f48524 X-MS-TrafficTypeDiagnostic: BYAPR12MB2760:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +U339mdIEBArjcjY3d0zUEGX3RzUjY9KnlNZF7r8gi3zgg+UPWKgxaxbXgbN1F/xZILedHPWz9j8whEbcg0JA6ufzje3ucB8rK7qJyt8JtIXm/FK8JIZYvlYxMfWHnKYK7YAv/D2B44rW/+pl6XC9iPwUDp3q8YnZNFloRMg2od6pp5X1gU/zVkk5+FtxqVeR706Y/NTHfKTLIlFxLK0aJ6r10txNEDBgOx9YJlMchnYeoBWUFNFgy56euCkilKSFf48lTH4xOicoFALiDHQ1wUWskUqIluJBbcQ/uuE97iQzazT6JuiekUcL7QcX73KWBGcWp8enmd4ZuTdpzIUOZLnxlSXnkx72FWbj4elqdSifsxgm6W/0uZt3tH2VLATQaL2E38uhXMx2EuMP5rC+4EU+urkJRdCJSsWsq9/5o9nNFNnysZ0tHZUSK6uUJj9FSSZCbEi5i98PLDg6mvXNY4aZP2FDwksyhm0Qr1de+wNRTPlY1OXgBpmhUUTEqrgmhoh11HyXLbVLVsb31IiBcQr+OBNaZ+4voDpd9GfQjeeLj6YEZgF7Jtck0OOb2yTkf3lsyGa68F85p0ry+YR27blXJuTD/590YRgC0WPdcNTmnweZGITTBs4Pl2NsGxjeP/amgRGzO2n0kkYbVbJ6GTX4a8+Fy2JT51LPt3V2p/GF7wd7b+qSgdA2NXiOUBg4gUBBKzEYKXcdZLHGL0wAJ7pa7CU3TCi5DIyrGPrlHqjzq4Kx0vSLAHuLJL8Iq/V 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:(13230001)(4636009)(366004)(2906002)(66946007)(66556008)(6486002)(508600001)(66476007)(38100700002)(54906003)(83380400001)(316002)(31696002)(36756003)(6916009)(53546011)(6506007)(6512007)(6666004)(86362001)(186003)(7416002)(26005)(2616005)(5660300002)(8676002)(8936002)(4326008)(31686004)(43740500002)(45980500001)(20210929001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cm1wVEtYN2QzbHo3bzQyU2pXYUJuazBkUlM0V2Q2UEI3N2FmRzNpMm9oQ01H?= =?utf-8?B?SWF2dWNHeklMcWNNajUzcGw2aWxYRlBIV05taTNONWZweDd1RzZXcUpvdTlO?= =?utf-8?B?dVpmSFlGSjR6dGtpdVRBd1ViOWFjY2Vrb3RkNHU3RmFjUElXT1NITy91VGUz?= =?utf-8?B?Vkk5dW0zR2pTTUVuT1ROZlJ4OVhoS04rVjhRMmNDeXYrdFc2SC9lRkdvMmc2?= =?utf-8?B?MDVmcE9UdDNNek1vVVJTSGRSLzl2NjlGUGlyQnVFNTltMTZveGR4TDFIa3Fj?= =?utf-8?B?ZC9nMkxwY3RtbDJ6dSs1ZlRkRjlmWGFOYm1kUXU0MUg3cFB6c3A4VHNJcW5q?= =?utf-8?B?UnZGYkduMmNUb0JUYXduaW5Vb3RVNTM1RmFiZVhibGNOK1hVMDJOVXlOTi83?= =?utf-8?B?eXkrQ0lMYzZCMG9kL0s1S0lwcEhJRjVObStwa3lLaWJQaGJWellCWHZYZ2tv?= =?utf-8?B?a0krQ2liMFR6ejV3Uzhua3JvODNpZEd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V1ZmF3RFRtR3lPN0VMdkRVUWFJeUpDU1hZN1BiMHl6?= =?utf-8?B?QXhjM00vZUhRRGJMVUV0aExJS1FGY2NzOWFTK2d3b3BQdXlISWhTdjdTd1pT?= =?utf-8?B?SE54REFtYWR2Vzl1N3VsYkhsSENZekdCQUFoM0hGUGlibW1hNDZsazB4K3U5?= =?utf-8?B?M2ZSVzNrQXliOTZ6V0N4UFNSWDFRV3lLbG5MZUtDOTlmWExIVmZneXFFcndx?= =?utf-8?B?d3AwT1lGd3BTZWh2bXcyRGlsMTNwYjM1TG94NDlxVjJuNHNTc1luRUFhWHNR?= =?utf-8?B?emdJaCtGVlFXZjYzYkduVE9aUGJJS1hKKytqSThLOFJQNEtBZjJTRWR2RmFi?= =?utf-8?B?amw2MnFoU2U4Yzl2L3FrZWNNUjRrRThVUVlsU3l5dVhVTFpQUmdRbHNyTjVJ?= =?utf-8?B?VjNuN0x3ZTFGQ0R6U25IV2ZuZGZHWXh4MTNsc0xZdUR4T2dsQTFRdUtsY21u?= =?utf-8?B?bERoZ0prdTBCcXg4anN3clNaZkF0RmtlUW1FdG1zT3N2ZTY2MXdHYUpVZ0lQ?= =?utf-8?B?RVNCcW9GeGE1d0JXSldyUzljYzlGUi85bnJiVlkwdXd5cXRJVGpWN1Q2eGUv?= =?utf-8?B?RmZOakVsdjVUcEdZZkVKVFN4MXljOW13YVlNSzU0RmNlZVFKVXkwMkV5czNB?= =?utf-8?B?bWwyOTlTTWsvTlRoYnQxdGVuU0Y4YkJpbWZoU3FDQWFmRjEzc2FYNER1dDAw?= =?utf-8?B?d0V6Qlc5dHZZaTByOHZIVFBrZnVPS2VSZmUzQVg1dis3UjJLU0hnTUZYTXpR?= =?utf-8?Q?XnDlVOg5gbP+YPVHJBAZ+tM=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f3ceefae-4086-4e86-e262-08d9e4f48524 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2022 20:01:50.8919 (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: YrgsQcYK7Xqx+jxn/u2LzUJSxhWK8jlq06ZD+Sh0BZ5LB8w4ArOtOzcdElJNm2sRlYHM1Ek6k6ddLlKKcZz6AQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2760 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/31/22 04:05, Jan Kara wrote: > On Sun 30-01-22 21:17:52, John Hubbard wrote: >> Unraveling the rat's nest set of APIs in mm/gup.c a bit more. >> get_user_pages_locked() was not helping at all, so remove it. >> >> Also, lookup_node() has only a single caller, but it is still worth >> having a clearer locking policy there. Changing it so that the caller >> both takes and releases the mmap_lock, thus leaving lookup_node() with >> the sole job of translating a virtual address into a numa node ID. >> >> Signed-off-by: John Hubbard > > Well, the point of _locked() GUP variants is that we can unlock mmap_sem > when reading a page from the disk during a page fault (hidden behind > VM_FAULT_RETRY). So as such _locked() variants are about reducing mmap_sem > latency rather than code readability. In this particular case, I don't > think using _locked() variant in lookup_node() is very beneficial > (generally I would not expect to take a fault there) but at least a > justification in the commit message should be different :). > > Honza I'll rewrite this commit description to cover this point properly. Jason also suggested using gup-fast, which I like. thanks, -- John Hubbard NVIDIA