Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6397065iob; Tue, 10 May 2022 18:13:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZmk4ap2ouTrKtjeI7yb7rkZXGzMvENQahq96xdUXe9OrA/SGhgcOurlYrVQMFCXUfFj9u X-Received: by 2002:a17:902:edd1:b0:158:8318:b51e with SMTP id q17-20020a170902edd100b001588318b51emr23198017plk.89.1652231591425; Tue, 10 May 2022 18:13:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652231591; cv=pass; d=google.com; s=arc-20160816; b=w1Sr34+IljDLlK5VlvLgiIO25C8p75z6ERN8+PqCDU3Wqae0VoYMEMGVWS9NXGvUpZ V7Lbhm1BtUOGox1SGIyvKyaGT3KmmZEdXo30bWtrZWptaNUOYnp1qlQG7VP3ds2pXH6U V9tn11w0PBG/9ROmMabVDfveJR/3gAaU2nNEDIzOltqYNy5dUIDPJcCkxuWYFuEyVWN7 dEyH4fD3W0WYaTcyCryhcathWRh8Wk/L+m5QQP97Uti+CpuVCJnVGP0hqj7tcc4SD5xX LUQdiTAuuQQrhV4JZiCvmLPX9OJfOIBvH8tW6p5ZVQQWCJcL9xxExMZRbHkMoV2wOrbX 1mDQ== 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:dkim-signature; bh=C0yWt55fZHZ4AXQM/Paz4YVRhXOV1nyt83/95U1XhK8=; b=CRcjkTrs5O+fVx/vbPfQ43P2cfJ0DlQEQ5t/cEK5qs5rx7iCpEZGRxDxjj8EDMLTda 81Dm9RH9nvjGRppENvEeoJsYPVk7ltZw79MCj1nEvUI4WDE+KZNxxh2vjLLeBaslMri1 5GHA1c9Ig5bKSm7vkaQm/UzdNFnH7/g2RPG9Ajq2TUjgyO5RD/aR3W19SQOWsfQ3V8vd VgH12VIbXlo5rVcNg3ZHMcWWTYCHwFcw6aBGK2BNEae3IXShCYYZ0Oz8aLOJkofD6/Xe 4/D+5i5T4hS5sZkKn3bG9uVVJcCwzfFPAD/GRpYZyfYfEZtkm4wUGqnVCATthXgh8Mpo dcQw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=gVa2I2IH; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Fld8GjwG; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m8-20020a17090ade0800b001ca8db710bcsi3931071pjv.179.2022.05.10.18.12.59; Tue, 10 May 2022 18:13:11 -0700 (PDT) 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=@oracle.com header.s=corp-2021-07-09 header.b=gVa2I2IH; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Fld8GjwG; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239822AbiEKAkN (ORCPT + 99 others); Tue, 10 May 2022 20:40:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237827AbiEKAkF (ORCPT ); Tue, 10 May 2022 20:40:05 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 298891339D7; Tue, 10 May 2022 17:40:03 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24AKa6oI024483; Wed, 11 May 2022 00:39:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : from : to : cc : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2021-07-09; bh=C0yWt55fZHZ4AXQM/Paz4YVRhXOV1nyt83/95U1XhK8=; b=gVa2I2IHowiTjAdrCIpzjHfwyV/KJ2L/V10EJu7iZq04qr+XD7JGzaQ4zO6FR11GKzSq QGko2e1ENoYxxCobAAaZYiJmOxkjaQiX1pTg6ynWJfbNFqID0JD/+dnEJY3Vlpvdiksn XwyP3rS0OHkBhHZfEoBK3w91j1x0ue6UWQJijEP+NZu1MIimbaVLZM1Q7UWw4+4Xo/N5 ZMUENJzuLI3FDPbvMJfLWn9wsAOLLa0nrxFjQYbgFCorFuirWEOyYr6uiQ9rC/R7ZhtM DL9j8Wn5Ozu50VHznB8DcmAxPFa+vRGQAeuLrxqYbQTZ4LwhbG4/yl2o+xkjwwytat98 oA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3fwfj2gber-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 May 2022 00:39:46 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 24B0ZOZq024391; Wed, 11 May 2022 00:39:45 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3fwf72ymnb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 May 2022 00:39:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OMIIOxgxCAlDL3V3giVs3XOAzzsQ6XRr/rxfsUewySvTYiAKGmvhwRtgMq+GtVdAs0Dvkp2K39vxbM7Og7F96au2jf9xkZAR+4GVO5h8cvYaXXn0fstJn1sjgagL75XIjss0rSw8Lftv55mW78di+hZWJxKA+jCTBgjGgqxZTlGy7NLb11xXyjwnCyVPWFnDlBx/A7DCYw/YU9fPhPEIhOMpOkpooyXcDxPJb49+wvcvvZnn0Q93iiKpi3/uqTDMgMPwpBMDttMW/UVZPLyp6lSEWb7sqyzDQHCfDXmGWuEurspix18dRrSMrKzBFF0v6TsrBiVpR+NZ/Ab8NscWVA== 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=C0yWt55fZHZ4AXQM/Paz4YVRhXOV1nyt83/95U1XhK8=; b=cvx2e2dsFWo+Uvry9neT96V9lg5uuTphLuAt6Gdteh/fI/LNor1zzChxtwF+XJTRmha2QN3PnFWNx4sdOK8QTgWxgNyy/dNPSEi/x7YyVfM82NFBkQmqUNky9PxzV1Bx/WVQ6s1owt8KI6MsodoULe0WWSnxJQgrFgxqmQ7AL6fe1p8OrMLHq2lk3KBiO1r2vSeEuTPQhHc+6Gv53uo+tIby01P0+G7A68amqilbzZKhnaIf5Gz95lRhj8OMqzf0N2vBvXl+xjW+hY8MWOf6kNJd6nTCjdBRsFlZhgU9IdVLkgXVCNkJrFxNwl9qFFRwqehRshntu6LfP353fogy+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C0yWt55fZHZ4AXQM/Paz4YVRhXOV1nyt83/95U1XhK8=; b=Fld8GjwGkqXF5YVTB00VtMzirMz6QOX8h4OXobInbMdCAUW6LJr0JI6faGnY4Nw7fKriUyczJFk1T3G2YdZnVKXFDRbYSwlBvc7UrATqJVehc9QvdScaxDmPrjMXF/S0yj5JaFs4GhYYojpw3VcsBNX/ZaWTy4gmBY2ri4Ipcwo= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by MWHPR10MB1872.namprd10.prod.outlook.com (2603:10b6:300:10b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.22; Wed, 11 May 2022 00:39:43 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::9d76:7926:9b76:f461]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::9d76:7926:9b76:f461%9]) with mapi id 15.20.5227.023; Wed, 11 May 2022 00:39:43 +0000 Message-ID: <9d64809f-db8c-0a3e-1ae9-d4a8ab79041e@oracle.com> Date: Tue, 10 May 2022 17:39:40 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v10 4/4] mm: hugetlb_vmemmap: add hugetlb_optimize_vmemmap sysctl Content-Language: en-US From: Mike Kravetz To: Muchun Song , corbet@lwn.net, akpm@linux-foundation.org, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, osalvador@suse.de, david@redhat.com, masahiroy@kernel.org Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com References: <20220509062703.64249-1-songmuchun@bytedance.com> <20220509062703.64249-5-songmuchun@bytedance.com> <970166e0-f70e-dd2a-c764-af23a8425f87@oracle.com> In-Reply-To: <970166e0-f70e-dd2a-c764-af23a8425f87@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: MW4PR03CA0048.namprd03.prod.outlook.com (2603:10b6:303:8e::23) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 77cf0bb4-c4c8-4384-5a60-08da32e6bd65 X-MS-TrafficTypeDiagnostic: MWHPR10MB1872:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AESCIQl6wJ2yJXbTI2h8aFkw6JJBt5k+tf2AewUidrtje8uL3GHybUuWOdg7WS2MAqseNMmGa7qQiW7uXpKUNEQte4tMz7VMtMVQ4pfZTBadI8AAexPmSLYUiB1I3E3z+arxDQQGl/Nh8qWJ5VfNX6y73nAr2pTeE8SnjiDQBrz+BniosRQs4fD4XtfC+IH/LB5N6nuxa7UCY8CUdt9xFX2d3eZ4tEfMhsqlNIzOUf0ymiqpGKwehhgk1z/vr9lMRlK9KJ6oXMx6Y6s7rYan8/b0RPMkXs0nyt8ueiHKPeITRqWBjEpqnJA1s9TqNazQ8E66e+NyF2f5v8V64tJDEIGvzbMQ4ApaM6VpdHTIiHfXmbaX7tyFGQxn+a36M9CcjpQkrX7/tFHO+r8jGSQXH+hwXIyGFCkOJHLOhFmSlYaZ20/gCMEQHPYnlr2AajVPMnkkW8LbYOx1ZgteIu6iJ4Q6SmkktIkHmTC2EDh/oWHcgtYPQcIIVtVl6ThvtS6EMEegJSSYeaIMlT1WaC7QHf59L1Ee95WyYlsOC/VTsdOlg2zJubpQhRklkIYpbsRjc5jhJKEFGKduLB23YNqvN0EGh0wqAqYLiLf3FgKQ0tKuriRlgHUCfnaHm9AIeIefjKgkSSxHDFnIKyADv98Uezqth3FvnCB1z59jRhBu2tEZZ9D+omdSCfYwJpOkkNTilML0m9IhiIaTcsYgl228sxx3pUDz1umK+KtBp9MVyu1X1NEKljm3wik3a/yVstxrOTUWnzTnNlDLzZuay+sPlg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR10MB4196.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(7416002)(5660300002)(508600001)(38350700002)(8936002)(38100700002)(316002)(66556008)(66476007)(186003)(31686004)(36756003)(66946007)(2616005)(31696002)(6512007)(26005)(4326008)(8676002)(86362001)(2906002)(83380400001)(6486002)(6506007)(44832011)(52116002)(53546011)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Zjd4R2UxYldiZnBzaUdWWmJvV1E1VGFobU9rS0ptWktpbHV4RFRJazVaR1hY?= =?utf-8?B?azNvcFh4YVl5bmtEMGVPVFpSWG1oM2MvRnZFeXVGNnRGOUt5cFVPSWl1Wmky?= =?utf-8?B?eWU5a1cvdW1BYmE2VmVHNUxWeUNRWHkyNXVYZEthblFwakxNYnVlZlgrcy9V?= =?utf-8?B?dGVuOW1ySWV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yZTAwakkrVnBmMnJU?= =?utf-8?B?N3VBYWJrMlJSWnZaanZVUUVyU2FyNFFTREVLN0Q0VDlrY1pOMkpTMm1mdjBV?= =?utf-8?B?dytvT2hvUDR4NzkwRFdGWENYL3AvdDhMRUQ3OS96VVZSR25ocnV4Y2pKZHlU?= =?utf-8?B?dlVTbDZJSC9lM0FYbk1aVDUzS1pVT09yemxhREtySTZsRTU1K2tmcnVOdFNU?= =?utf-8?B?TjJSSXdCdHFVQmluakRaeC94ZkZucUgvTmdzc0lWOGorWUZQSHI3bjlNcFpo?= =?utf-8?B?V1hoSlRUbnFMd3VyakM0TStubkNxSXkrS1dGeU45SitGS2tSaTk2dERwR21N?= =?utf-8?B?VTZVbW5ET2dHd2ZGbXRJNTArWDNldVlWd2dSUE1zd3VORElSczgrTnZrbloz?= =?utf-8?Q?JKrxyTx8iXJgfX9g=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77cf0bb4-c4c8-4384-5a60-08da32e6bd65 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2022 00:39:42.9624 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GubFXcN4Oiluwpd3DgncR4LQD5OL68IwQnRjznMg58Lwll0XQb/I2CTTM9ZXdiEj5GUtcJPt9PBQuREHFf7HDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1872 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.858 definitions=2022-05-10_07:2022-05-09,2022-05-10 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 malwarescore=0 mlxscore=0 mlxlogscore=856 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205110000 X-Proofpoint-ORIG-GUID: M2BZ_9kCC44_yXE7FXcoS2kbv6p9LzEX X-Proofpoint-GUID: M2BZ_9kCC44_yXE7FXcoS2kbv6p9LzEX X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,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-kernel@vger.kernel.org On 5/10/22 14:30, Mike Kravetz wrote: > On 5/8/22 23:27, Muchun Song wrote: >> diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h >> index 029fb7e26504..917112661b5c 100644 >> --- a/include/linux/memory_hotplug.h >> +++ b/include/linux/memory_hotplug.h >> @@ -351,4 +351,13 @@ void arch_remove_linear_mapping(u64 start, u64 size); >> extern bool mhp_supports_memmap_on_memory(unsigned long size); >> #endif /* CONFIG_MEMORY_HOTPLUG */ >> >> +#ifdef CONFIG_MHP_MEMMAP_ON_MEMORY >> +bool mhp_memmap_on_memory(void); >> +#else >> +static inline bool mhp_memmap_on_memory(void) >> +{ >> + return false; >> +} >> +#endif >> + >> #endif /* __LINUX_MEMORY_HOTPLUG_H */ >> diff --git a/mm/hugetlb.c b/mm/hugetlb.c >> index 8605d7eb7f5c..86158eb9da70 100644 >> --- a/mm/hugetlb.c >> +++ b/mm/hugetlb.c >> @@ -1617,6 +1617,9 @@ static DECLARE_WORK(free_hpage_work, free_hpage_workfn); >> >> static inline void flush_free_hpage_work(struct hstate *h) >> { >> + if (!hugetlb_optimize_vmemmap_enabled()) >> + return; >> + > > Hi Muchun, > > In v9 I was suggesting that we may be able to eliminate the static_branch_inc/dec from the vmemmap free/alloc paths. With this patch > I believe hugetlb_optimize_vmemmap_enabled() is really checking > 'has hugetlb vmemmap optimization been enabled' OR 'are there still vmemmap > optimized hugetlb pages in the system'. That may be confusing. > Sorry, I forgot about the use of hugetlb_optimize_vmemmap_enabled in page_fixed_fake_head. We need to know if there are any vmemmap optimized hugetlb pages in the system in this performance sensitive path. So, static_branch_inc/dec is indeed a good idea. Please disregard my attempt below at removing static_branch_inc/dec. I still find the name hugetlb_optimize_vmemmap_enabled a bit confusing as it tests two conditions (enabled and pages in use). You have already 'open coded' just the check for enabled in the routine hugetlb_vmemmap_free with: READ_ONCE(vmemmap_optimize_mode) == VMEMMAP_OPTIMIZE_OFF How about having hugetlb_optimize_vmemmap_enabled() just check vmemmap_optimize_mode in a manner like above? Then rename hugetlb_optimize_vmemmap_enabled to something like: hugetlb_optimized_vmemmap_possible(). Sorry, I can think if a great name. -- Mike Kravetz