Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp234307pxb; Thu, 17 Feb 2022 02:58:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzj1VJJ8NBd7DmZaq42Vcf0XdV+NNsQkF3xYN5hmpFYV/RyQWnj8yv7I6Y/teWf+ijxxLTN X-Received: by 2002:a17:902:da82:b0:14d:c6d8:822f with SMTP id j2-20020a170902da8200b0014dc6d8822fmr2277725plx.55.1645095529300; Thu, 17 Feb 2022 02:58:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1645095529; cv=pass; d=google.com; s=arc-20160816; b=WT1i7v1bFeJH2vNXlL5EF5Vv59cahJHDJILZEA4v4TmNIOO/Dsm+OQvJtdiFe0z/DN 6d/jYPL/XTmnWs0V+lBOT0M0mQnz1wI7iKhIon+Q9BIMjZdGSvtcqc4bgxCLnCs6wfo8 khnN2W+hS5araQH5sXfCZMijM14DwjXkJ/yuxBisSkkQ0AjHUokDjhmdBfAyhkiLem4J 5R1GS/dE/5FL5auct4BZ2oaTGxJ/QO0UyZsAqbdE3DA9OHhw3JipqzN5d26pQDmVldIC ZECnQcwh87CQ2Htl2QXSOFSN+aZCTTm70drxwdd4mFkpxLp8HVORkdctHdb18lmDNLRE tCMw== 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=XWSEFogcEBpvQCfCf9gUNHzGkcZExlvDb4dDNCJeOAk=; b=uW1UL2gGZPKqa9TFGq+H9qbA2ZxBcTllnu+Q3RaVtQBCbOzNFmqwpq2vPc7CqvcW8j zywMxiJ8+pZIUHENGhjuYIAoghIumUMTXf7E6Rt9oUrSg+AHrDLkf4btcJDpOUvlKgIg 2WREvBuuq8gt/CBV+M5+2OWkLYpmbxWDVmf477MmexiGF8Eb7i3mwXATsEg9J2qN6BOg mjKcjOlkkadkTMqDAZkxNP486RKlLpLiULdSrYHHy2xcf97eV2RD54+nXP8m3SMSN0Rv kcNwPVyPRUB5cRsThF6QJnVRixYXkrSJS7FGFdJSxpjsSRKvJQHu9PA6LrJiRcl2PSjg LThQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=r2o0Ddin; 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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oa3si613930pjb.31.2022.02.17.02.58.34; Thu, 17 Feb 2022 02:58:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=r2o0Ddin; 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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234480AbiBQFrE (ORCPT + 99 others); Thu, 17 Feb 2022 00:47:04 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbiBQFrC (ORCPT ); Thu, 17 Feb 2022 00:47:02 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2088.outbound.protection.outlook.com [40.107.94.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DCB99AD9B for ; Wed, 16 Feb 2022 21:46:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tr/IeK4K40UcEPiTtEoTJ4PVr8hG4tgefEWwcJ8suVf113dfpqdz34H5H5Iqtk3BrwcW4fRuqR2ztsQAq3EK5BSyL00rw3MLCKHs7x0F/UaeJANrQTBPivJov9plZJdo2RMcjULy4hUVMpqJC5jWXqjfm9Oz4+7hhlE+6XG5G5RLjeHws+eLrLp7L7KPWuTgA1Wyaq0+er/2JAqNLrfY5peQ0EWzAqcacu9s+//IjW3FPORfXZSI67v8NJAOTYbNf07YgN2nF2qA1z2mREdi0QjGWmZgG+B05zgggKAK/70T3e/FQtts9Jp5ZSRJKVotJzhpxJXnRWsLB84ZYvF4hw== 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=XWSEFogcEBpvQCfCf9gUNHzGkcZExlvDb4dDNCJeOAk=; b=Gr89XsRQ8A+p2mA/+1s2RH9kJ8EIGOa9dY1zG/3ZMXeJdI1jqI1QtqA/USOfLMqhwNe0H9QcpydJ0coG0h9a3YW1AXKXpdXx3xE2DPqjacveacl7B9AoFdP8meUHwlNoznR154j0karb3gPyAj2OybLKFBmoFbFX3ZtMGuJ02vv2GTQeDRAUE+w+lxBuP/VO76BiU1D7TprtLFlP1eOflZFO4CMIjs4uRV9B07Rkfyk+TXqZqdVsspM+QHGiH2IVFgt/+LHDIpCT1G3FLQY6d/GXjXudKVnSN9T97089RwD2s5uxb7Z4dsKFGSEv+M2q9OfJGqiT0GO01H5rEwDetw== 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=XWSEFogcEBpvQCfCf9gUNHzGkcZExlvDb4dDNCJeOAk=; b=r2o0DdinMmOqlk0tFAQIqdwSJAus7DxD/8inPDAweDUXB3i6P5PM1051xTTzFCHy3qynsCBSL0wNOrFVUI3m4KjchK8duLeHkbkrc5PWDteB8lAGfeSnV1EeOPr8Dbyf8h3gb/xF4fZfUkL9Pos5XKdGlzRq1oc/GYRNA+WS8hxAiRA4AVwHMzk1fXDetoXogCkzQjvs7fO0nyzXcateEN5f0VkGQ/YnVthiStAdT4pFJ3korqukRYhL8VT1qmgsVA9aejOsrTtGQxPVZELOfglNB30wF5LuPEvbHwJrCrd19j95qWGsqrL0b5L1zhm09m+LkRG6zXkrsc+KLpTH3Q== 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 MN0PR12MB5835.namprd12.prod.outlook.com (2603:10b6:208:37a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4995.16; Thu, 17 Feb 2022 05:46:44 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::498:6469:148a:49c7]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::498:6469:148a:49c7%6]) with mapi id 15.20.4995.015; Thu, 17 Feb 2022 05:46:44 +0000 Message-ID: <790b82cc-ea85-3483-6626-8e047260e603@nvidia.com> Date: Wed, 16 Feb 2022 21:46:42 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v4 4/4] mm: Rework swap handling of zap_pte_range Content-Language: en-US To: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , "Kirill A . Shutemov" , Matthew Wilcox , Yang Shi , Andrea Arcangeli , Alistair Popple , David Hildenbrand , Vlastimil Babka , Hugh Dickins References: <20220216094810.60572-1-peterx@redhat.com> <20220216094810.60572-5-peterx@redhat.com> From: John Hubbard In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR13CA0043.namprd13.prod.outlook.com (2603:10b6:a03:2c2::18) 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: 134e3ca7-6711-4d00-f677-08d9f1d8e117 X-MS-TrafficTypeDiagnostic: MN0PR12MB5835:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T60YWeA2bbveZmL/q9Yebel6STnVILsJGIpp+b5lwm3dXQBy5zDkahrpchvEgsaRrbdzxx/g/FtyZkObAaNBkxwjIaxnmbgDQyYou6yA9fhlhLmOngweC58peNxm8yY0+ujxanTm1AO4fSSwdFrw2L/GBJhfTC223fdPxT9ukpaS/j1NJ1UH1SaN8Ov3v3tTAxIu3NfDbGjzO1aUILlhW0xm40os9WWkX35l2zE7+Nk8qI2y8EqUIEnpSkPok5+qP4ggckSfqxHytCQbBRFAeu2c77pmBpxvZgYKBT3LlbhtOm51+LDngNOU4KobET9/PYj2oejerLSS2t0m9go3mayAVpsdCV0nD5aFn3a6ZfOCewkqj0vwBa3BupKfHMTwYjNp9JUaC6ISEqtWmw2woRFfiMnuCjL3MX1UDWD9x7GCz3f0fo4YOimsgl05ZOLx/2H00zD4tgHiN2kBrpiZ/8vGpTcR2JwA8I+DrRU4OFF7A7cF40rQvX0pCEDSHgon9Y7BmCG4GeMygkWgLFsZsBxCVepTraAy7TReFze/s7yFeKK+RL50X0D4pCKhDLihPixecmm61xwQNlkOI+k/CwuWrG+orM0Xkx0Ft96nAzSwMkIc2PftgVI1DawljJBHAiw9SuBxnYZeCv5nz6zc4QXpeuvslKtS9Nir+0IJ1gWrrbBUD/Z+HYWxzKmVw33LNKip1qj6AderQ3RcKWs0fMliVWcLM7jr2mMISXD7EAeliinubdV9Za54Fd11Oznq 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)(66476007)(83380400001)(66946007)(4326008)(8676002)(66556008)(53546011)(6512007)(6506007)(86362001)(2906002)(31686004)(36756003)(38100700002)(5660300002)(31696002)(6486002)(186003)(508600001)(2616005)(26005)(8936002)(7416002)(316002)(6916009)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RFpSKzErOGtocXlYc2xYaWFqZjZIVkVBaUlTSjJmS3o2WHVuK2p4WjY3b0Vp?= =?utf-8?B?YzMvNFJZUUwya21CYzZteFg3ZVVUR09ROUMydzV2ZVVTT0RPNEROdnl5S00y?= =?utf-8?B?QVNLQ2p2ek9FM0xsTUJmRUJ6QkFZNnNpMjNwZ3M2djQzcnFRNFU1WjVldFRn?= =?utf-8?B?dHA1VWhBTXFvc0N5aXVCZGEzTi9FM0hsSGh5Q2tpdnFBaGFsY1RnMnhuZlhJ?= =?utf-8?B?NjlncTJVeFU2dVZFTFdSM1o5cGx0NFV4K2JWaks0T0tJT2hFR2J3dVVFOGNL?= =?utf-8?B?bVlEeEFwL3NQK0FodndB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?B?aXBzSk50YTRvK2hIVUkxMXVUTE5EbTExSTdwczA1TU5YeDF1dXJLWElucWRu?= =?utf-8?Q?XQ1Xad4L/7QV8jqHK4AMOuc=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 134e3ca7-6711-4d00-f677-08d9f1d8e117 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Feb 2022 05:46:44.2403 (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: ogl5MsqrLmWHaXkEkR+wI3B+PaWODJK3VEX5Y/hN+Af+SFRnaP1Po4sWByIwocMvVS7Fd7IhZ81NnDdkfnQA9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5835 X-Spam-Status: No, score=-1.2 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-kernel@vger.kernel.org On 2/16/22 20:54, Peter Xu wrote: > On Wed, Feb 16, 2022 at 07:25:14PM -0800, John Hubbard wrote: >> On 2/16/22 1:48 AM, Peter Xu wrote: >>> Clean the code up by merging the device private/exclusive swap entry handling >>> with the rest, then we merge the pte clear operation too. >> >> Maybe also mention that you reduced the code duplication in the >> is_device_private_entry() area, by letting it fall through to the common >> pte_clear_not_present_full() at the end of the loop? Since you're listing >> the other changes, that one seems worth mentioning. > > Isn't that the "we merge the pte clear operation" part? :) > Somehow that part wasn't as clear to me, but... > I can add another sentence to it, if it looks better to you: > > ---8<--- > Clean the code up by merging the device private/exclusive swap entry > handling with the rest, then we merge the pte clear operation too. We do > it by letting the private/exclusive block fall through to the last call to > pte_clear_not_present_full(). > ---8<--- > ...no need to change anything here. I just wanted the list to be complete, and it is. thanks, -- John Hubbard NVIDIA