From patchwork Mon Sep 18 23:01:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Kravetz X-Patchwork-Id: 13390558 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 6708BCD3424 for ; Mon, 18 Sep 2023 23:03:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 89DD46B045F; Mon, 18 Sep 2023 19:03:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 84D736B0461; Mon, 18 Sep 2023 19:03:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51C116B0463; Mon, 18 Sep 2023 19:03:03 -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 193406B0461 for ; Mon, 18 Sep 2023 19:03:03 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id E4FA41C9ACE for ; Mon, 18 Sep 2023 23:03:02 +0000 (UTC) X-FDA: 81251245404.05.E5A1B97 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf15.hostedemail.com (Postfix) with ESMTP id 93F7BA0048 for ; Mon, 18 Sep 2023 23:02:59 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=oaNOFPV6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=R+392oTd; spf=pass (imf15.hostedemail.com: domain of mike.kravetz@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=mike.kravetz@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1695078179; a=rsa-sha256; cv=pass; b=jLsKG9Wklm3XBHBaOhbBqx9BBs4gMH2FOnN3Tllgc3zZZ4pcuwZrDfXhueGiVEeiIJqerD /Pg8VBUgc0Q/N8Zo8n2SNnpDnDa5glyqp1D5XIU/Q0qavP8fhmxXwIFQdDsWNv2CwE1zVc 3NiH+APpiUaBQJH0/YUPEtXCV/SSqQg= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=oaNOFPV6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=R+392oTd; spf=pass (imf15.hostedemail.com: domain of mike.kravetz@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=mike.kravetz@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1695078179; 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=L95tnfc0CA4c741dFYEs+Oc7CEYreRyaczmGsZ9qoZw=; b=yuOpAImJ0uAbjRTjJxefx0dYiMjOL9bqKOmSFcfpzlgD1PU4xs5/8nko/x2cZEnqilEP4F rv+EJ6pDDf1asTPkZb/oIzYeAPQvDMCmzBsaFhHry14EqDaRarqEtXPWoG0k4LZZ9VIoPJ Eaf6ccaEqR4rmMNI89PxvYazDDIhej0= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38IK53J8016873; Mon, 18 Sep 2023 23:02:14 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=L95tnfc0CA4c741dFYEs+Oc7CEYreRyaczmGsZ9qoZw=; b=oaNOFPV6+NhD/4uADFBOH5g6t2k5k/9sPF2nezz5Yau3kC5ZyE5Jeiti/2SS6i6Vrwo3 obKCZcbyE/SCurC6CfEG+KF+S+Gz3cxWvPn+u5v/415W20nnsH5e0JArZnlhuqnD3rPu UqyOhdwqCjeUtpBWd9FPRvyWNx7TohjgIKqRls+KdOhryLi3rtV5ryyzecZ68PD9x04x 4YDEG/e/CdwEbxnv/ObSzrnxLPCfp3TZK2d+TvVY1ci3xXdqm879Hy3ZvwJNMw62cw+d lD0fNctKT9tgKffmnNGFOvAvj8zKN64ZVFo4IYLN5QdlxyNYzzSHydr8G3C2oFiV4Z24 rw== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t539ckqdm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Sep 2023 23:02:14 +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 38ILqIbK012157; Mon, 18 Sep 2023 23:02:12 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1nam02lp2041.outbound.protection.outlook.com [104.47.57.41]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t52t559w9-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 18 Sep 2023 23:02:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jCDvfE/v4N+GCtV0RhZNXwP/HqyPhnVPdU7ZSMVCpLbLGk9+ACV9KGNQBC5TJ1nilnQXsL7/xT9pV30KqGJfttHS5ryJLA1OFV+BJ4rSFw/hByKIwLYXRNHeGcFEIUSPaDz23jDtNwBlpDw0WXR0pXV/zHzzCOFWNe62J2jAw70vL9swxAeCeI5Dap+rRVbTwnafAPgcC8NfxBvfZCMKqNv28sBOGO1O46pct/30dwVQfzDtj1OjAVq0YG7uWE8zoBNIhKVVuk3WK4CWyzJJDR+r+lpdUtRd9lgeeqnmqH7de+fNGLyKQ+kJpURMmqNo3u6y+5U54p7fqFy9vU68rQ== 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=L95tnfc0CA4c741dFYEs+Oc7CEYreRyaczmGsZ9qoZw=; b=MQZhTnh0X/Zkq1gzR639mIdO0ixZONT5ogj6wHoT0KP1sx8BsYkdHjJFX3xPcPmii+eospBgzjTCKoWrv+km+D5N/7eow8g4/PyWt409649RSe43Mkoh0+TWYM1n1ctzVa2Qwgf0Zt9ICxVxx3WxfrmPo0TGMv35ELXOMAUs4ZPo68wItODkRunRqsJ+aC2jIRwZnoTs/++6JaWOpnlbTpowIe1ctgmTlzK8RI9FJNQnWfxrZ/Fjr4t5impjP1lobuHkFNWrI+ek2a0jHfUnXdZ/1mJwGvtyi/QFKBwJrSV5sjkjJOcQb6IYM+HfpHXhU09t9MkxUD5zdffykx4hsg== 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=L95tnfc0CA4c741dFYEs+Oc7CEYreRyaczmGsZ9qoZw=; b=R+392oTdgx9xufT56DvB7OyGeXAZSBH2DYNZf4WvLDPB36sY/JfqNJ9gbV+6dRQzzRe72N6tmwhrnIiWd3R4DPQApbMgFgAd5IRi2LYTjOwM/ZylZq1z3OC2dmUNzJ7N/8xAmKxY1EYUR7m/Xsh2ydUyKBU88TUO6aUAW7qMEFw= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by DS0PR10MB7204.namprd10.prod.outlook.com (2603:10b6:8:f3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.24; Mon, 18 Sep 2023 23:02:06 +0000 Received: from BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::c621:12ca:ba40:9054]) by BY5PR10MB4196.namprd10.prod.outlook.com ([fe80::c621:12ca:ba40:9054%5]) with mapi id 15.20.6792.026; Mon, 18 Sep 2023 23:02:06 +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 <21cnbao@gmail.com>, Michal Hocko , Matthew Wilcox , Xiongchun Duan , Andrew Morton , Mike Kravetz Subject: [PATCH v4 0/8] Batch hugetlb vmemmap modification operations Date: Mon, 18 Sep 2023 16:01:52 -0700 Message-ID: <20230918230202.254631-1-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: MW4PR03CA0265.namprd03.prod.outlook.com (2603:10b6:303:b4::30) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB4196:EE_|DS0PR10MB7204:EE_ X-MS-Office365-Filtering-Correlation-Id: 36b898ee-0f2d-48c3-b4d8-08dbb89b479b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: REFkz7R0yX/8I728rPW0FYV2oQV65VK8pU//NGiBf/1i4YPJgd17ag/c0kiuKiMHsj0ZBLOKJmV4AcSCOpwLOtjI26bmBPH2AHt4Ejbnp0mV25aldvfY2v1yFZSkbJlJjpH9gLks5gHCzz4YwSqZXc40B8B+g6diFLZHT+klSUwTP2kFqaygfX2KYPYw7qz8Nvmizxxz3R9bPeWfz5TkBaOji49180Fh75QjXLQxyDUw4I11M0OErJcA+JOeFDHtQzcDh7uxXuiWWmcqOifTXXml55eLmm7dHe+LlYJCso0buFPlq0urGwz0sDQXU8sVKVgD70VM0zb3RXWc/QtLVp0YSxef8kiwJTlJBIKUSd9/VMxzH83dJmSbi+Of1VeZgMnKlthbmqrFsOmtmjicintfr1AIan3U5cwjWpUl4BWmb8jal9d7PpA8dNBfmnxyt/auAm89prbFzzXDB+X2ymKJqjZwAPLBe3C6O4nJfAy7ae5XtOErAdL94CXAUMnrRqnTUlKLcV13CHfB3UX5YryhlQuwk12xCmGJT5Bz59Bp7mYNgeDmt/kngKhhiVJI 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)(39860400002)(376002)(136003)(366004)(396003)(451199024)(1800799009)(186009)(6486002)(5660300002)(44832011)(6506007)(86362001)(6512007)(54906003)(316002)(38100700002)(66946007)(66556008)(41300700001)(66476007)(6666004)(478600001)(8936002)(2616005)(26005)(2906002)(36756003)(107886003)(66899024)(8676002)(1076003)(4326008)(83380400001)(7416002);DIR:OUT;SFP:1101; X-MS-Exchange-Anti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5BEGzQ?= =?utf-8?q?FRFCxlZkujVPRHmQnFKZN15rWNQVnPrSGfr48KSxtBknXDjMrT7CjPb70TSKrnGEo?= =?utf-8?q?XaXrbd/P2kdlBLOBqLzSVOIDtuf5bz6pV8djVEnkqepqEblQXHEY1zZTP6rwN9bwM?= =?utf-8?q?kmaTke1UmdvaGkEj93E4LIAovZf1r262nmCjNDWXB3HNP3XEpTkIuMYXkvf++w3Nh?= =?utf-8?q?IWVwAykLtrLXbQWDPQtzbFa+VDcFE1bPZYAhaXHF+JWm2AhJ4t/RUorZO164I/SAi?= =?utf-8?q?Avifx+82+md3yIL8vf7RrRE1Odkw82RMPEMpPytqJJKWUIlGEhYzh4ayPNusCemGe?= =?utf-8?q?HcK3FzYTgcsfL8KY1D+GQs84Npd7JsB+ZCAO9ZiHcNB56kDFss4CFRCQT7YYLtNQt?= =?utf-8?q?xxTo9QLAlRZ8QaJ5DkgTF7b00h1uUtqQODpSGP398shqOMmHoT0c/gFq/wHj/PTAt?= =?utf-8?q?Vq8xQWf2LxZyBtU/BMvEAygT+aZ7cpjAp+Fgajuy/E9Fv4d2OAYzg92pEoqdR212C?= =?utf-8?q?raBviy44cGXAZrtR9QQ4KstsoPWZSxeIuPcP41pnjlrlP0vxll5e+HMLXvkqk0nMc?= =?utf-8?q?ED8uhKTR//IthjB3EMzSuy9sQ7tYYbNrVdf9ly8Aj9CZDoxgLJMEOIhTbG5TlPAAb?= =?utf-8?q?pplKXDTQuXPNO4iK389isO/BKeHnuozK1PkC4wkx3AQsU3YlDytDaSZty/Px6CpLf?= =?utf-8?q?m8hKNxagqg4a?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?Gro2qvli7oyjVfBi?= =?utf-8?q?lbAQrUh2RwtisRBsYuff+5NNjYpNWcCttdSfTz1quf62cXgC90ebatWpQuZ6tfzQi?= =?utf-8?q?BBaVphU0egkcFPYc7YDiSwkC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TNdHpWenk39WB4Uq39kmu37Fi0DNPskIqxxD1L18G?= =?utf-8?q?q2a5uilxsuNI96eOqSGa5O1JPUTsaI2TA8haHxSbjq5eyGAaPwzL7GsFSOAsgorsg?= =?utf-8?q?APh7u5s6nf6MZxbpN3wm1FVBR3p8BKH?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36b898ee-0f2d-48c3-b4d8-08dbb89b479b X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2023 23:02:06.5425 (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: TNSFOqjmYuxso8AGGMAKxZoQOMa7bFnjn/xr+yZysivUoyPKy6ecwPRQBmSm1o41m2ptxRxVuD1JQRQARRGIWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR10MB7204 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-18_11,2023-09-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 malwarescore=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309180199 X-Proofpoint-ORIG-GUID: XBAhOLFLSVLh2sA84lOOWwOv6cOTf4JD X-Proofpoint-GUID: XBAhOLFLSVLh2sA84lOOWwOv6cOTf4JD X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 93F7BA0048 X-Stat-Signature: 6gf1qjdjwrhqcstnerzn9b1yg3mxdjk6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rBauSOBVFavasLlI1DiR8uvaVrInO+rZ9ts6AoyM9H7kZiwp3OKhMHueX6fJ4s9UfJ+eNE4leJpUCu2netHtQ5hK+UoWeo+xzd+FuvZDmMQv11ndFBNodEGaiiY+NA2zoU9ohmVmmyKHqaYdufUogPNatm3MEdEHFv5sNB8blWP7gwKLMyjjpTgUVhFoGNjmJ1MhadQnSdUYuXBO48WqbP7VTlrYke9pDqRYoy/icARiMikVFVyPh1sUYejIqTjzpQwkVkWSW1xbvAUo8q1FP0dNYyuLFzzuMjiJV4hsvVd7x2+c3qdx3UCoaNe/gCHBW40f3iUEmpoDbwU/EsswzSl/hx+rteyj1X6NzzY0pyJFdr6zaKwJn6IEI7dJfAjlQgdu6S7UX/gafyYnN4vCnTZSdIvWEwaIH1x1KuufaVjYQ== 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 mm-unstable (September 18) Changes v3 -> v4: - Rebased on mm-unstable and dropped requisite patches. - patch 2 updated to take bootmem vmemmap initialization into account - patch 3 more changes for bootmem hugetlb pages. added routine prep_and_add_bootmem_folios. - patch 5 in hugetlb_vmemmap_optimize_folios on ENOMEM check for list_empty before freeing and retry. This is more important in subsequent patch where we flush_tlb_all after ENOMEM. Changes v2 -> v3: - patch 5 was part of an earlier series that was not picked up. It is included here as it helps with batching optimizations. - patch 6 hugetlb_vmemmap_restore_folios is changed from type void to returning an error code as well as an additional output parameter providing the number folios for which vmemmap was actually restored. The caller can then be more intelligent about processing the list. - patch 9 eliminate local list in vmemmap_restore_pte. The routine hugetlb_vmemmap_optimize_folios checks for ENOMEM and frees accumulated vmemmap pages while processing the list. - patch 10 introduce flags field to struct vmemmap_remap_walk and VMEMMAP_SPLIT_NO_TLB_FLUSH for not flushing during pass to split PMDs. - patch 11 rename flag VMEMMAP_REMAP_NO_TLB_FLUSH and pass in from callers. 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 Mike Kravetz (6): hugetlb: optimize update_and_free_pages_bulk to avoid lock cycles 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 | 266 ++++++++++++++++++++++++++++++++++++------- mm/hugetlb_vmemmap.c | 255 +++++++++++++++++++++++++++++++++++------ mm/hugetlb_vmemmap.h | 16 +++ 3 files changed, 457 insertions(+), 80 deletions(-)