From patchwork Tue Sep 5 21:43:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Kravetz X-Patchwork-Id: 13375113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2C04CA101A for ; Tue, 5 Sep 2023 21:45:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0EE96900004; Tue, 5 Sep 2023 17:45:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0538B8E0012; Tue, 5 Sep 2023 17:45:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFD67900004; Tue, 5 Sep 2023 17:45:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B86C3900003 for ; Tue, 5 Sep 2023 17:45:17 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 8B540120B05 for ; Tue, 5 Sep 2023 21:45:17 +0000 (UTC) X-FDA: 81203875074.14.B27AC40 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf22.hostedemail.com (Postfix) with ESMTP id 28CD9C0002 for ; Tue, 5 Sep 2023 21:45:13 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=f29JHKDg; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DfIqUJdw; spf=pass (imf22.hostedemail.com: domain of mike.kravetz@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=mike.kravetz@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693950314; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=Omeu3vW9x4nTdyOqJ2H6+YUj63kgueRXOqd9WWVLTdo=; b=Igg4GcXnNl4plvU/5dwn3hewgwGtEhwtadqC7yG+xN0dzU/XHjbLkYb1z5HtXZnGdUehhq Rz7OU/bOi37wm8w5cFmSftn53FIzK329wRRH1cQn/jyWGZ4ZVniQZt9j7wLbD45EKvWoXz lmsTlth5ssrojSHrFSzqT5S83y0f77k= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1693950314; a=rsa-sha256; cv=pass; b=wB3wa+BOiicU99aP1DI+zhtFGl6+RwAcEFJgbELlSVSn0SUaLs2HJsu9Z0AlC9u3cz1vGv TzxcyTudapad8wjoWpq0YfR89C7matEnWs/NLbZQBwQ8/D2hAWxqTudJc1QBC8QwcQjBH3 U2kvcfk2wD+Rqij/Wd8nHwrzloUZc+4= ARC-Authentication-Results: i=2; imf22.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=f29JHKDg; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=DfIqUJdw; spf=pass (imf22.hostedemail.com: domain of mike.kravetz@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=mike.kravetz@oracle.com; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 385KnnkX009401; Tue, 5 Sep 2023 21:44:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=Omeu3vW9x4nTdyOqJ2H6+YUj63kgueRXOqd9WWVLTdo=; b=f29JHKDgjDVkPaFIdCvqI3EZ3JaxkBFpZ4A8iO5Sl/5KQraP9GYaB8gW4Lb0NfpxtCFC 13jbaroxShhHUcIm98qvmGqNzvk/Uk21WRUJoqtvKU3igeod9EEr6a/R/MOaMNYdFvGh 1/7/LZ0eL8xfsecP4vFIAnAHZcHxqkWC+fe+tCVxAZruGgvwlb0wTOg62VXx56pbEUqa Wg23q3HIBKsT+kmN+RnMfzuIGqT1PWw+szPVcrFL2pY4wHkrwM8SSxzz6c39M5gceJjD Sr0v8iP+Abj+Jh35/ZTaQEoO5A3DHK0nMQCaj6hLOo1ZNK/JBXU8X+DS7dsOAX5HPEtA YA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3sxbq383r0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Sep 2023 21:44:22 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 385KA9He037099; Tue, 5 Sep 2023 21:44:21 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2042.outbound.protection.outlook.com [104.47.66.42]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3suugbkmr4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Sep 2023 21:44:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PRmD6QouwfIuGzMveQok7t5CtOXPaQ9bREn1i2PVGfNaeqxN70zfT83vrLgoqX6DnYAO+PbVZtz1rB8QiX1a+vVValZBLYRCMDySnQngMMOOaY6gHxNjcjqjcayswY9CB95giNLb5AS30Em7laVft5QDvZawNuc0paJ62uGKzdt5SUwvARE9dfi+tC8mbTWjFBAWZifCSuIVS2nnd293DbM4k5ofncE97kwwGy4jARZ478BdDMyAKvt0MjCO14+no70EaUSHHnyRMQ3vFvKIkVQmvQOy8eh+euuttjS31HJiURSNSzeHzKARu2WUYvAD/1y7GZ8SrfuDF9fMj/xHyg== 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=Omeu3vW9x4nTdyOqJ2H6+YUj63kgueRXOqd9WWVLTdo=; b=cwrHwLJkf+Yt+/IwDtkCIyBqovPNvopLRXy4HRRCwbI8k+E0eswBUOxAkRsQllE8Ooqgn43LVkhVL9eD1X7eBGzIJIia1sM2ktfDFiLXAPxLb8GslgB2KG6vTE5OhjHqY1wizV53AlNVV/iwL+n5pAGjZB0Qs6F3NlXuFwjcADS/OQIeEqJ5b9dltS1owV0ziDLNTq27OrhbibNf+DBMsdANSdmT4HqMHtCpg1AhDVEKhdVQT+mChcPIFJXQBxJ8P8YvI/dGnBz9TKmdc0z3n7ClbdRLnp/F3wAzlVA1v7J3oX6TI4RyYRBfUIk2yZWspcMRpHlxUlak35XvwxB6VA== 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=Omeu3vW9x4nTdyOqJ2H6+YUj63kgueRXOqd9WWVLTdo=; b=DfIqUJdw2uzlby+5ofvcYl7VOpkovVOwaz5MUwV2tVq7p0p0QWT5deTLNA1J9CWK7+RRPsbjPjJkrx2cANF34nhYIpK41AM3KPQtEGk8xSJicNfuXdo7gtSPqJnMwLQVJrbTDDa+AzfZjyYsBhtMYCHgTPIPpeokHMpSRbnoRD8= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by MW4PR10MB6395.namprd10.prod.outlook.com (2603:10b6:303:1ea::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33; Tue, 5 Sep 2023 21:44:18 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::58d8:cf97:ae4b:1715]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::58d8:cf97:ae4b:1715%3]) with mapi id 15.20.6745.030; Tue, 5 Sep 2023 21:44:16 +0000 From: Mike Kravetz To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: Muchun Song , Joao Martins , Oscar Salvador , David Hildenbrand , Miaohe Lin , David Rientjes , Anshuman Khandual , Naoya Horiguchi , Barry Song , Michal Hocko , Matthew Wilcox , Xiongchun Duan , Andrew Morton , Mike Kravetz Subject: [PATCH v2 00/11] Batch hugetlb vmemmap modification operations Date: Tue, 5 Sep 2023 14:43:59 -0700 Message-ID: <20230905214412.89152-1-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: MW4PR03CA0340.namprd03.prod.outlook.com (2603:10b6:303:dc::15) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB4196:EE_|MW4PR10MB6395:EE_ X-MS-Office365-Filtering-Correlation-Id: 15193abf-7438-4861-1642-08dbae5940a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8GsfMIJsS/EN+KaxNcnunEjxIwvTSWzaC90RFFixlEo42Au4bXYRnNz2Jk05n88uWI+utI+xcQM7nq035StAAjgP0gW9IYm6tqur0yh8tO2qOwOI/jhAtUgyOQIGvCD15XsERsciN9ioYU8TRvLAadNmkl322LmQrYDTuRX7RS/1Hrjnty1BRvp0D+nEbaNSl9dbcJcCIkJDxR8qFUemndtQ9esGTyd3QaWCTyH02PCIMLfDuMzYB8vMInwElA7jUSFrTxwzTTbiOkUaW21/NJ/kk5bWiTRQMuwmbKoWXrHSB9upgRRCnrngyGUEgAf2w3QMAVped4ThzCSDwgGK0pHyu+fNpTBuWCarPg9bS9DMtalIlBmGmZ897E8qRHGjVoGTVpN8tKNWeiGzab+Rt5rTSL5uUn7CyY7lI8F28J9niXw56Ox4mtgpVhtF3TkxFlRVrkSEpR9o0v3mRgy8AWFkTycEGESli6hV/I2QBDWq2i5JFELPPHEfSQSN1+Ps4cNeWd+OeN0kUQI7Y6uCNqOM6PxnhieKH5xATSzue4RZ4SBKQZ5APbQX0+nz13mS 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:(13230031)(346002)(376002)(366004)(39860400002)(396003)(136003)(186009)(1800799009)(451199024)(66899024)(6666004)(6486002)(6512007)(6506007)(478600001)(38100700002)(2906002)(7416002)(107886003)(1076003)(2616005)(26005)(83380400001)(86362001)(36756003)(66946007)(5660300002)(54906003)(66476007)(66556008)(316002)(44832011)(8936002)(8676002)(4326008)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-A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3OOJPWZ2KozXyEbIZdbAGmT8r1OHr7vjswNio7?= =?utf-8?q?UNXyE7M0LTQMBgb0YQKrgcut/5IiQG0DDGsFQifWjJuPGx+mwLFgumorIYG7bc50n?= =?utf-8?q?LnUP3fCC2zJuzOjuhOEB9b/y+OfL1LBz/Aw43pNpK6+C7gcHMj7HrsbjBUTqfdLUR?= =?utf-8?q?hu0oa295SR6wjkESuAiWb11xZWgnCS/vz95+kqX2ssVTNPdl2z9D5rGhjGp/5tPpA?= =?utf-8?q?FCJo5304xrqofJG8wf3/bBwNxbgOjBuc+ekNDjubiVRjUCJM010bc2wFauhDc7cTo?= =?utf-8?q?yy/oPlTBrKxuP3nYzljVgkxYtOPBgOq4Xk9iiHO/Njo3P0EEm6sOxW+S3oWeeLZho?= =?utf-8?q?2lJQUg/yTddLOWlDZNW6ZUrRsBjBqv2Vr6m7lx9i2ZtT3Ufu2hEQJXGBw//9xdGL1?= =?utf-8?q?6a2xpsp8fXs++lQGiANZa1IANuOWQ+qy6biwlr3JZlWmXq7waTT1XGb5QGM6qYpn3?= =?utf-8?q?nAndITGIIQ+JnDRfQrg2/GaHRtsC7N7IAFICItGhMspq/bh+zmQYn2oauNSIs9qTn?= =?utf-8?q?6b8rqw9/32/DC5SuiBoGCdLO/td/7WLpmW7ptDjnfPnfCvDLF4mo1b6/Yj38bTYum?= =?utf-8?q?MCjL0K1LdOS4eAvtb+AD2Sem0qU+rkKXKUHDUFmgFoY6A7i8omhD6AmEOWu4hbAAH?= =?utf-8?q?rURCdUOwB0tE?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?6Z/P9akDnHZMwPTw?= =?utf-8?q?rpoEFwFaGW3iPsJB4pSLfMgRjeNRAfmxwCHdX23jDcWJKT1mzLAMBoaVBmCAtf5rn?= =?utf-8?q?EJoWBnUqSuJi+ECqYAZQCiI57PhDeXvIunjdtBKI4H85SRfbAM/CAews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r5yOQ3NtuIShAu?= =?utf-8?q?WOp1CLyGXvaYk5wbkWgwcfy2J8Xrmz/yJH3X7HttLP/ttccBKj36V2KPNJn/9L5/Q?= =?utf-8?q?pZi+DcFu98fbkq5NMlhM/FvN6j2Blqn?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 15193abf-7438-4861-1642-08dbae5940a5 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 21:44:16.4945 (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: Fk2mkK8f0inoBhffQ56L0SoYky0CS1NxO6Yli07x5yW+MI0iHu7k+7xZsxbwadGk8y4SG20a65OJYXjtJ+QrLQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB6395 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-05_13,2023-09-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309050189 X-Proofpoint-GUID: _wBsUF7NX-oHcZnvgt1rjxYR-31vF0Om X-Proofpoint-ORIG-GUID: _wBsUF7NX-oHcZnvgt1rjxYR-31vF0Om X-Rspamd-Queue-Id: 28CD9C0002 X-Rspam-User: X-Stat-Signature: t9sye1smddeqygkst933nqb7edyhnuzj X-Rspamd-Server: rspam03 X-HE-Tag: 1693950313-195966 X-HE-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dA/A2ZrY6GwZ5AZvNVLAxwoSVacWvgN/royPrrMr2RW9oIBB/XxGRqlhJaBxP8C2TjKaj+D71wUrWe/AC6pdNmJK+ovgfFBqeqPK0nA4OXWpuRNSFw0RQm01k5TTxYCOixRafex4LKICgFyUxxJI0welygtPWevRAZQczhyExZ1r3OPSxnZ+rGT8Mji/EKZyUcoGGTN/pQ3PtgGm02K3W5uqtHEb0pIAr5QW/62jjKaNYVt4APfwl0GYMCOClW/kZboAWIAJEN764Tl+7/USmc9/rbZTbzT+x8r31LUa3siYXUVxpZoZEbzDzW7Ehi2ZKIVn2rMH45HgdtX5vKwMTVbLp0J+4CARvAHIfC+04ocXRFVTZ7VGw9luSQyX0NwbGfXpTJD9jfNtVV8fQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: When hugetlb vmemmap optimization was introduced, the overhead of enabling the option was measured as described in commit 426e5c429d16 [1]. The summary states that allocating a hugetlb page should be ~2x slower with optimization and freeing a hugetlb page should be ~2-3x slower. Such overhead was deemed an acceptable trade off for the memory savings obtained by freeing vmemmap pages. It was recently reported that the overhead associated with enabling vmemmap optimization could be as high as 190x for hugetlb page allocations. Yes, 190x! Some actual numbers from other environments are: Bare Metal 8 socket Intel(R) Xeon(R) CPU E7-8895 ------------------------------------------------ Unmodified next-20230824, vm.hugetlb_optimize_vmemmap = 0 time echo 500000 > .../hugepages-2048kB/nr_hugepages real 0m4.119s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m4.477s Unmodified next-20230824, vm.hugetlb_optimize_vmemmap = 1 time echo 500000 > .../hugepages-2048kB/nr_hugepages real 0m28.973s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m36.748s VM with 252 vcpus on host with 2 socket AMD EPYC 7J13 Milan ----------------------------------------------------------- Unmodified next-20230824, vm.hugetlb_optimize_vmemmap = 0 time echo 524288 > .../hugepages-2048kB/nr_hugepages real 0m2.463s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m2.931s Unmodified next-20230824, vm.hugetlb_optimize_vmemmap = 1 time echo 524288 > .../hugepages-2048kB/nr_hugepages real 2m27.609s time echo 0 > .../hugepages-2048kB/nr_hugepages real 2m29.924s In the VM environment, the slowdown of enabling hugetlb vmemmap optimization resulted in allocation times being 61x slower. A quick profile showed that the vast majority of this overhead was due to TLB flushing. Each time we modify the kernel pagetable we need to flush the TLB. For each hugetlb that is optimized, there could be potentially two TLB flushes performed. One for the vmemmap pages associated with the hugetlb page, and potentially another one if the vmemmap pages are mapped at the PMD level and must be split. The TLB flushes required for the kernel pagetable, result in a broadcast IPI with each CPU having to flush a range of pages, or do a global flush if a threshold is exceeded. So, the flush time increases with the number of CPUs. In addition, in virtual environments the broadcast IPI can’t be accelerated by hypervisor hardware and leads to traps that need to wakeup/IPI all vCPUs which is very expensive. Because of this the slowdown in virtual environments is even worse than bare metal as the number of vCPUS/CPUs is increased. The following series attempts to reduce amount of time spent in TLB flushing. The idea is to batch the vmemmap modification operations for multiple hugetlb pages. Instead of doing one or two TLB flushes for each page, we do two TLB flushes for each batch of pages. One flush after splitting pages mapped at the PMD level, and another after remapping vmemmap associated with all hugetlb pages. Results of such batching are as follows: Bare Metal 8 socket Intel(R) Xeon(R) CPU E7-8895 ------------------------------------------------ next-20230824 + Batching patches, vm.hugetlb_optimize_vmemmap = 0 time echo 500000 > .../hugepages-2048kB/nr_hugepages real 0m4.719s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m4.245s next-20230824 + Batching patches, vm.hugetlb_optimize_vmemmap = 1 time echo 500000 > .../hugepages-2048kB/nr_hugepages real 0m7.267s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m13.199s VM with 252 vcpus on host with 2 socket AMD EPYC 7J13 Milan ----------------------------------------------------------- next-20230824 + Batching patches, vm.hugetlb_optimize_vmemmap = 0 time echo 524288 > .../hugepages-2048kB/nr_hugepages real 0m2.715s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m3.186s next-20230824 + Batching patches, vm.hugetlb_optimize_vmemmap = 1 time echo 524288 > .../hugepages-2048kB/nr_hugepages real 0m4.799s time echo 0 > .../hugepages-2048kB/nr_hugepages real 0m5.273s With batching, results are back in the 2-3x slowdown range. This series is based on next-20230905. The first 4 patches of the series are modifications currently going into the mm tree that modify the same area. They are not directly related to the batching changes. Patch 5 (hugetlb: restructure pool allocations) is where batching changes begin. Changes v1 -> v2: - patch 5 now takes into account the requirement that only compound pages with hugetlb flag set can be passed to vmemmmap routines. This involved separating the 'prep' of hugetlb pages even further. The code dealing with bootmem allocations was also modified so that batching is possible. Adding a 'batch' of hugetlb pages to their respective free lists is now done in one lock cycle. - patch 7 added description of routine hugetlb_vmemmap_restore_folios (Muchun). - patch 8 rename bulk_pages to vmemmap_pages and let caller be responsible for freeing (Muchun) - patch 9 use 'walk->remap_pte' to determine if a split only operation is being performed (Muchun). Removed unused variable and hugetlb_optimize_vmemmap_key (Muchun). - Patch 10 pass 'flags variable' instead of bool to indicate behavior and allow for future expansion (Muchun). Single flag VMEMMAP_NO_TLB_FLUSH. Provide detailed comment about the need to keep old and new vmemmap pages in sync (Muchun). - Patch 11 pass flag variable as in patch 10 (Muchun). Joao Martins (2): hugetlb: batch PMD split for bulk vmemmap dedup hugetlb: batch TLB flushes when freeing vmemmap Matthew Wilcox (Oracle) (3): hugetlb: Use a folio in free_hpage_workfn() hugetlb: Remove a few calls to page_folio() hugetlb: Convert remove_pool_huge_page() to remove_pool_hugetlb_folio() Mike Kravetz (6): hugetlb: set hugetlb page flag before optimizing vmemmap hugetlb: restructure pool allocations hugetlb: perform vmemmap optimization on a list of pages hugetlb: perform vmemmap restoration on a list of pages hugetlb: batch freeing of vmemmap pages hugetlb: batch TLB flushes when restoring vmemmap mm/hugetlb.c | 283 +++++++++++++++++++++++++++++++------------ mm/hugetlb_vmemmap.c | 210 ++++++++++++++++++++++++++------ mm/hugetlb_vmemmap.h | 10 ++ 3 files changed, 387 insertions(+), 116 deletions(-)