From patchwork Fri Aug 25 19:04:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Kravetz X-Patchwork-Id: 13366217 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 833A6C3DA66 for ; Fri, 25 Aug 2023 19:05:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6D7F32800CD; Fri, 25 Aug 2023 15:05:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C559280055; Fri, 25 Aug 2023 15:05:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 269332800CD; Fri, 25 Aug 2023 15:05:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id EF18C2800CE for ; Fri, 25 Aug 2023 15:05:39 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id C6D071C9B4F for ; Fri, 25 Aug 2023 19:05:39 +0000 (UTC) X-FDA: 81163555998.13.31FC19D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf06.hostedemail.com (Postfix) with ESMTP id 0231D180008 for ; Fri, 25 Aug 2023 19:05:35 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="kydeZ/2c"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LUiAa428; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf06.hostedemail.com: domain of mike.kravetz@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=mike.kravetz@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692990336; 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=BTzPIkANJp0rh79GHiBKzRm23vMFSpwqWk+/XhZ4h5A=; b=UzvMIJWK7WHQzU5MS761ok2q5c6fkxZQ0qFRok8ewLZjecaUz7h0gdoRxFsL2t9l0+uv1+ AHB/72oidCt4l0DWLECvQd/BBoJKN5PPuP0IpgeK4gItYBqBAb/cofJkahnZKIFlLwi1A/ LzFUR2A2UDZl44CvQXwWSobAAKqOJP4= ARC-Authentication-Results: i=2; imf06.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="kydeZ/2c"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=LUiAa428; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf06.hostedemail.com: domain of mike.kravetz@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=mike.kravetz@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1692990336; a=rsa-sha256; cv=pass; b=S18WvLNN7TIF/sUBrokV+MCkKizWPeyts6ojoTqsM1adutMBTQ4I7uAxdlEn0mUq+y2djF qi5Geqvx+FfRI56CEuYTlgmSQKr5c6+5UCa/Gu6h3lc2OfdvyVkjirJ8L4uggrTuVsi7l9 pSPV4bI3ehdEoUfr3KMEss82JMKq4XU= 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 37PIERgW031110; Fri, 25 Aug 2023 19:05:02 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=BTzPIkANJp0rh79GHiBKzRm23vMFSpwqWk+/XhZ4h5A=; b=kydeZ/2cgre0OpdYHRijEIzbb68yyu8XGFKGFNACIesfAyKllbQHNeOb1AWCCcjDQ1Mx Xf4I78ybUPVJIIrdlWsK6fH/vumxVXwBMDHgGb93i9h2TCZ8gjF+SFPL0Mwz1Rr2MyV3 PSjoVk/OFzE0MBgesNRXcemYtos5RKfnz3OTk4Gmwk4vtRxfopfDQQu1uUKC4cyOoLn+ eqp0HUFTd5Jlr+ChYRGoM6CMzgUoDHGfTMrsVQzYZJdAcy/DdYV0qGzaftKwFPzqMmWP aJXZc3VyrtzpA21QnLvqxztg91UpBqjRxEZD7ZYjAxE2QehcnpNJELwvf15DvqwOaTv7 Mg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3sn20cq0ck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Aug 2023 19:05:02 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 37PIgohL036118; Fri, 25 Aug 2023 19:04:47 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2042.outbound.protection.outlook.com [104.47.66.42]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3sn1yxqs0d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 25 Aug 2023 19:04:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NwGV31fmJU4xUmZPoeNIUEd4m2Rd4uCai4ZpS+jH5pzYHTsVzFknOnnB/I4qu95ndHj1eG8nh9ylFEbycxS8Xp8v75sF7kUuN3FcxAZLuQuLJLUkmc+AZesni4KXff4RswvzPKwRRh+7dexWQpR35xw5GhjPhfnXzkaZwJWKmI096OvxchWSAN1+Eab5DkrcTBnqLcQ5WjqV7R0RlURAlDpbRojZNNwQxqHEwAeDZmnrYr8nl5aEvMhOn4O0pdAZchTHUTa6A9/zuMBgRda6gaAAXgD++EpBlB6+BNe4QZLDee6jqreCRJb9u711kcKG7TGfC6BDvv6IZveGcayQ1w== 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=BTzPIkANJp0rh79GHiBKzRm23vMFSpwqWk+/XhZ4h5A=; b=Wqs9k0Q+/UDyWTwXiT/pIDA0/sX4SMr6FL+QCpSiBffIxJjerYIdap/yUs3FpLocEGZhVVPoa+0zIhlVY1/OXMsABmuSkd+QSx3bEaJnH5qluPiYOfNK07y/COjAi5a00TNp+XAtBsN9cKpPTTpHHpjon5fABJ8KkIVAAId//eBwU3N3iEuolgLfcmeoNSCHXccvYzreEXDABHO8xeAZUf0KSeNGnr+6nmjA1JAAu0VKF18yfZ+2r+AIsN6diG6uyHoXAdW69qugZMQ00rH1+LFiO9w00oLQSnBMj47LqR6qFylAqG+sC/io+83tIEgkt8JyL7lZArnCH0aHlAdHmQ== 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=BTzPIkANJp0rh79GHiBKzRm23vMFSpwqWk+/XhZ4h5A=; b=LUiAa428XUOe4OnZe6m3Ay3Tf55DXlhTfIDhSFbrYZ8Bxm0XNgnsn8I52JYRxM4vAdiAB3j6aDZ5wjtMCK4TBaDb9CZ7QFZeqqvCE6KSJ16+0Yf1F0878NhGNfFR1CPm3m62rXPbMEBT41RjHtTT//quJLthnGpFe5/38NqwtmM= Received: from DM6PR10MB4201.namprd10.prod.outlook.com (2603:10b6:5:216::10) by DS0PR10MB6895.namprd10.prod.outlook.com (2603:10b6:8:131::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Fri, 25 Aug 2023 19:04:43 +0000 Received: from DM6PR10MB4201.namprd10.prod.outlook.com ([fe80::8057:a3e9:cbd1:252a]) by DM6PR10MB4201.namprd10.prod.outlook.com ([fe80::8057:a3e9:cbd1:252a%4]) with mapi id 15.20.6699.022; Fri, 25 Aug 2023 19:04:43 +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 00/12] Batch hugetlb vmemmap modification operations Date: Fri, 25 Aug 2023 12:04:20 -0700 Message-ID: <20230825190436.55045-1-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: MW4PR03CA0119.namprd03.prod.outlook.com (2603:10b6:303:b7::34) To DM6PR10MB4201.namprd10.prod.outlook.com (2603:10b6:5:216::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4201:EE_|DS0PR10MB6895:EE_ X-MS-Office365-Filtering-Correlation-Id: 84e203b4-c728-442e-0063-08dba59e2433 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qYu6yuSnkxZCy0k5IDVEj0UuBjF26l51q9i1npUHYWs2CWITcdmqcOT/KEcr6EBbXzlKqMPsBo9Epi86w6AOYlgEsP3ylh/hzmhOZ/OvVBncHXKsH7QM+bQd5JQtH4B+cGyv76OTtT8PTEn1NdH6VdvVvxHBqqgoEM8R9oigYHL0GIsF3fHpchG2FJQIMC7UhJOD2GfxLN9bokKtHbFv2fRLXbU92aicZBB7mzFrbG89zRa6bE3GG9MR2iMxg+FpP8aEglkRcnM34JasxkYiF0uUxaKoneabG2OTzRVDoom11/kVoAx/NudKweQiu0CwiucgJg0UbDZDR6PgFqbjPtM1L3Uq9DmrIqtXgZGvaPXn6sVD2X1SSi8QyqVGx0jPHzJPtOZmQHsG0OEswvaMu+NCyImRgFiw6RY4W2HM/sQQYCT5EuH6r5mgoeKOjI0b65VxniI674DT/Ex2ehekHvFZEoZg5e36hHk/8/rkskP7d0fX3GQGzM+OhRi7VYWHocyurw9FB498Er2vz3/ZwxR6lo9h399vQ9MxoGYuMEQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4201.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(39860400002)(366004)(136003)(346002)(376002)(396003)(186009)(451199024)(1800799009)(54906003)(66476007)(66556008)(66946007)(316002)(478600001)(26005)(38100700002)(6666004)(41300700001)(6486002)(6506007)(86362001)(6512007)(2906002)(966005)(83380400001)(8676002)(8936002)(2616005)(4326008)(107886003)(5660300002)(7416002)(44832011)(1076003)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?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oMJRadc7r0au75KkwG89G94Mc/DoX?= =?utf-8?q?QkQ1eiURbLbX3FInaO6rryPuKGzxAkcAZ8Jnlu55waaCWUADveeSHJacfC+FGEpZ4?= =?utf-8?q?SrATaQxWNO3stkgA/sa1a5Z+M1Kub5QnMRVsQ0n4ohYaYjol7ZtQpKf2FwKw45qhX?= =?utf-8?q?Nq2OqLAcxOS6abuvu2sdJzL5y4hFJVugTlc8VAzD6koT2qVQieEd6g9LnvEjKzgl+?= =?utf-8?q?a38VJ6htJ9OpYPpaqjtY5zLwLkYil1vGvN9T6y9GthzQ8o/NmK6j9S3p9vQPUzt7U?= =?utf-8?q?NymaoxoniB0adAEQLCrYef0DBMQK9xhIfaaG1jS7Xg9iIVmg4q7YAwESrvO26jUgh?= =?utf-8?q?wAmXYGFDfnP00dB8ES3ajrZ1JjK1GUNkoBFA7uM20Knu6uvVFytZ6rqVfTcWpy95n?= =?utf-8?q?mrEVVdWwk1ZrMsteEfkLyqxXzYtJZdt79meq0uUc10SN8PC/XnYSR+c+scFPFWlb3?= =?utf-8?q?rjzvjhPQ0u3z5RcR8+Q/QcUczxGONOiDwz5uqPy/ALZYafMGLKuLRYGB+93L+ea79?= =?utf-8?q?bXom24EgBD03Jxje/wkTVpr4sPFmnTp9WveVb4lp56lxQ8LjgFctFsJj7PUaR4Jfh?= =?utf-8?q?MRcY/6sw9/kby3dPpHcizIYdMec8PYnZZMkGjRQ0mpUMBJaUMljKhRysROSeALB85?= =?utf-8?q?w6Nqjn0KpQRC?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?QPBfeNJIGl0YFfFY?= =?utf-8?q?NVJzO650H6G8r7ge6ZNmDcyLsFKku1IcwoYIy6AtjE9r7PFr0NdzXoCmtMNsGd9p/?= =?utf-8?q?JhmQ48PiMnOEkOHY2j8Me5AihgAnivmwsShUWxyxQHUJdX9aFNnNC91XBfZTHptzo?= =?utf-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X7MYmU2C/GQ+BPkpzsr6azBcIAxRmamTKzfAbzvcjwApPY4X23I8vT8Y?= =?utf-8?q?fMKPMjUbS1uDaeOsCvwwhvwHq1pU5ZI?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84e203b4-c728-442e-0063-08dba59e2433 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4201.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2023 19:04:43.7257 (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: cb829GyHTVnCnNmpLUxFj0LbTw5+b1NT2KysVzmGJ4eUEk4Z9/ZbtxdQ7EKXQaFLPO87i60UX6VQPrWOL70jbw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB6895 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-08-25_17,2023-08-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 malwarescore=0 spamscore=0 phishscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2308250171 X-Proofpoint-ORIG-GUID: KLQGc-luRAyMFKnEbBNBC1dpACx_DpMK X-Proofpoint-GUID: KLQGc-luRAyMFKnEbBNBC1dpACx_DpMK X-Rspamd-Queue-Id: 0231D180008 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: 61p1egj7fmqit8fqse9ufh85nta5o1to X-HE-Tag: 1692990335-230886 X-HE-Meta: U2FsdGVkX1+aQrMaKI6VJ/CxC0ah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M05uG8pnYKmTIaRq6HWDuse584fAB4oGmbx0cor1efh6DF/0z9qCJin/1yDcLAj3bKZrjjoTzV8lb5QibNNOn9gis1lNE6QVLKWg+ais7RF0U4OwJTjVW6pBpiuYpWGAlqEe2r2uXPhwBeFqKHEguhc0Kk7cBg4XoSYWne8k1LC6/0aJMAlEKlZYRIgY02dzxATgSHEotLMku1UD7YVNfbX6SgUj3zF5XdphjNT+EiGkUWUc0C7TY/doBw4ODM8Oy3/0ixdrZi2KyXEEJq6foPxPj9PzRt3dpbZTEyY9DtAElk9r/NUMgCSPhxUF4vZXiDxMZsw+B89wyLcaEAiHTuYiS/H/vSeNtpBvubs+gjBKfYIMa7mxkUy3212Rcd5LICSsBQtkx4oRIfD+Hi/5wmCXj2XM= 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-20230824. 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. [1] https://github.com/torvalds/linux/commit/426e5c429d16e4cd5ded46e21ff8e939bf8abd0f 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 (7): hugetlb: clear flags in tail pages that will be freed individually 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_vmemmap: Optimistically set Optimized flag hugetlb: batch TLB flushes when restoring vmemmap mm/hugetlb.c | 238 +++++++++++++++++++++++++++++-------------- mm/hugetlb_vmemmap.c | 197 ++++++++++++++++++++++++++++++----- mm/hugetlb_vmemmap.h | 11 ++ 3 files changed, 343 insertions(+), 103 deletions(-)