From patchwork Fri Sep 15 22:15:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mike Kravetz X-Patchwork-Id: 13387780 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 8544BCD37AD for ; Fri, 15 Sep 2023 22:16:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B9336B0377; Fri, 15 Sep 2023 18:16:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 168926B0379; Fri, 15 Sep 2023 18:16:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EFDDC6B037B; Fri, 15 Sep 2023 18:16:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id DCBA56B0377 for ; Fri, 15 Sep 2023 18:16:33 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AE1341CAD75 for ; Fri, 15 Sep 2023 22:16:33 +0000 (UTC) X-FDA: 81240241866.01.1440198 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf15.hostedemail.com (Postfix) with ESMTP id 4AED0A002A for ; Fri, 15 Sep 2023 22:16:30 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=KSLisCBD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=IYwAB7yO; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1694816190; 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=qivZngOpRxmOmRzB9eRb63RaXMdYCj2C+bkKYI1jEhI=; b=S4FLct2GXj0q7UvoXZZohkdDruCc+x774YOsSiwsGHdkPeFxEzj3tA9iiJ7gzdSUzj2GEc tyTV+C/SLrVv7qzBfZ8Ytl020hYPpYv4/3es4Zbdi2kUgSF5239BG55aC42762DBOMLViQ Wv6wn5gxMUoZJsFyitkxNNTkKL5oWOk= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=KSLisCBD; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=IYwAB7yO; dmarc=pass (policy=none) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1694816190; a=rsa-sha256; cv=pass; b=AoKn+5N9bCQsWtYoz5WKLcwstHNujRdMpKWSFrEaHl4aYs2H+TA/HfcykOR/ZVqKyPAdb8 q9fFdihqMRQzYtVI7T1/ONJg3NW2Narad6TZDi8+vtL6m0PXC8P5c+0vIXFpS95gmMxn7Q OM8i7iG9Ufb6YzVg80fTulzAbgl5Cj4= 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 38FLtxMN026316; Fri, 15 Sep 2023 22:15:56 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=qivZngOpRxmOmRzB9eRb63RaXMdYCj2C+bkKYI1jEhI=; b=KSLisCBDr2XDJDns2qqzM7IrgtTQoJu+X+Ppe3aMUObiSD/pFbQp73uyjZzO4oWQQ0yI /WS5PV8PT2+fnJFTqDrsgdjglU2p1mrlNwiIbxRSxNEC1CZIUYeN4Z6g/zZRS6RU7nOS D8U0hr/PdihvbODmSMznXEo7HD9jmdJe+gc4/M1bs08dQRmNz3f8iM+8SxNSxvDDWaVn AykxTt4dvU3PHO3viuFdEyxrQ3RLgouSGWfBCl7woQF85H4YrkJOwwz0AyKtxyCImKeK BAVbBj6yWgd3UEN37V/ihRCdEja7FgWLnwm6oZ+zBXtq9Pdodpx2QD53Pki+9g/xzM4m TA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t2y7prnyd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Sep 2023 22:15:56 +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 38FLFlNV036185; Fri, 15 Sep 2023 22:15:54 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t0f5gx8qs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Sep 2023 22:15:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SDiDejKQMqBe4Fr2Js9winF4A6s7Yf6DD8dfZ0LN7whnvWYjUrLaGTo05/q8z7gxFRnyi0rD7/33E4uK69GjzKEwj0x5ruLXT3Y5lhb4akFOakTCbgus6uNJkDOS8wd/zOSk/9gLVAbOHTE1BrFxFZ72OkNzaGHnRSjiE6BLOGuUuj9pj5of+gZ32bBj012pvXoiFz4CztxIs2GnIts1P5UJ1TUZ1j1VSwXyauABcuj836623rhk1zi1MwuJGZEDX4eWTwkfK5pkXoda69iJlfUdfJz6zbTeA+6KJzqDtQWTi8iThnIKYGJ2mb17HdpHJYvK3kfTyaQ3S73Hm/NlpQ== 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=qivZngOpRxmOmRzB9eRb63RaXMdYCj2C+bkKYI1jEhI=; b=nk/avYhMbLJIDsXIUE6ejZkB4IM0syji09H9q1DBkMzeDMSEH52BJfUwf+dOY/t52vuwGC0p+JvRvMW3GYOjPy2G5/tp1IDPu5ADcwgig9lRWqmhqu9YQMchxuc9zg1N7zamZgsauuPrzItYExvrGUbex6bjg1k1OhtQCFCJyC5bPvpwJH8y7ny+QWg7pJnGYuGpurfawkNUpdJPPKk+7JpQs0auwvSKQxHhtKWO+/GjKmyXG/Lxhff07iO3rUdcF7hn8RnXOwLnFwuC5tFB1VyRLjJFSncjxM68h5X6vTUycwLUDWmQzwxFVkxIoTZGF+Q39YCv/Qqup7tsTmgsEQ== 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=qivZngOpRxmOmRzB9eRb63RaXMdYCj2C+bkKYI1jEhI=; b=IYwAB7yOOXcF/POtmf+6+sEUQpVDkwd+ZWP6eBytx/MApV/3GMLDExzSAYAjO508TgR+PGktGNMbu4HZcY5DMkvgkypfsJWLv9e5NZXAkrzEYDNlJsIipg6IM8j/9zysX8vrGQH5/ExS8eg3XsHhHHLaPrB3DfBKXSufR4ni7Pg= Received: from BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) by MW4PR10MB5861.namprd10.prod.outlook.com (2603:10b6:303:180::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.34; Fri, 15 Sep 2023 22:15:52 +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.021; Fri, 15 Sep 2023 22:15:52 +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 v3 00/12] Batch hugetlb vmemmap modification operations Date: Fri, 15 Sep 2023 15:15:33 -0700 Message-ID: <20230915221548.552084-1-mike.kravetz@oracle.com> X-Mailer: git-send-email 2.41.0 X-ClientProxiedBy: MW4PR03CA0350.namprd03.prod.outlook.com (2603:10b6:303:dc::25) To BY5PR10MB4196.namprd10.prod.outlook.com (2603:10b6:a03:20d::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR10MB4196:EE_|MW4PR10MB5861:EE_ X-MS-Office365-Filtering-Correlation-Id: b025e1e6-390e-4230-6d18-08dbb63952b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VwV5NXTK8B2FUqlUp1yTp9INkvxGbBtIUk0jths/YdzzYsqM24OsIliuBvERhxKQDVjNPwCNfAJSvXOE5X4YTQ/3L1mFH8KBIYHBz0TwW00nQQsTDyNlWO219QbcqmNfe+e45bB7p89897oWhmfutQ+x5QQ1l8scVMB1xMv4dByfSb7FDWSEOmYkzkFYIn2L+qq+lMBCVauVdy8tFpOvRdcpL80E6jLPNjdKuQHkLju6ll7XgWS4F+K/FM+PJIRwBLoOzsCle3S+yvJCJQngM6fu7JD6EukgpScFzJgog94/XEjvCb1Kme230mVQtexMN/bQKyNHGVEtVejO1FlVFerK+BimIVMkIGE+K60M0eJCt19SPDnANqBBQL6Fis/jFljZwDL6cFM1xvMyrkzWb7HetiN7vWq6P1HVDagwYdljMkHsjsUOnX7Jp/Fq7hVOgysjTyH8kuYPdXRJ6PtvJdfuRWVyK7z5/1Au7F6SH/eGljNtCodvM9E0aHDr/36fjgjf2LC/Z1ydTbliURZnzyk1Ds+nTPXe05BGWaWuTLMX2nP9D2HsF7TnICjbBY2d 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)(396003)(346002)(39860400002)(366004)(376002)(136003)(451199024)(186009)(1800799009)(44832011)(86362001)(36756003)(66899024)(83380400001)(2906002)(38100700002)(478600001)(1076003)(2616005)(26005)(107886003)(4326008)(6512007)(41300700001)(5660300002)(6506007)(6486002)(8676002)(6666004)(66556008)(316002)(66946007)(8936002)(7416002)(66476007)(54906003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-A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B/GJZirOOmblgnlqYtmoQ6?= =?utf-8?q?+CRk9bQRRc3fG1MA7SMj2cmmgF6PuYgq9+ubbc3yfYKqqlYzGbf8uVaEOSVEBgrj2?= =?utf-8?q?awvlacq3Rc481sgpMV3T67f/4Y6NMaO?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b025e1e6-390e-4230-6d18-08dbb63952b6 X-MS-Exchange-CrossTenant-AuthSource: BY5PR10MB4196.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Sep 2023 22:15:52.2025 (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: JUwb6sULeI+sucv6V8eSoqjZmv/VczSS9mmUZhgEEbqnWx/OA8OzwAq8ZA4v+4rpRf/8Zu0yHae/VN/bOEOX2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB5861 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-15_19,2023-09-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 bulkscore=0 adultscore=0 phishscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309150200 X-Proofpoint-GUID: ReiDg3TvbRjN485bMLuaAEjvHi7QfA-D X-Proofpoint-ORIG-GUID: ReiDg3TvbRjN485bMLuaAEjvHi7QfA-D X-Rspamd-Queue-Id: 4AED0A002A X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: mc9ugoy3wmj5hdmui7rbxjxsp99obh39 X-HE-Tag: 1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2D6wyhBrD7VsnPNTv9aCkeTfpgstoPED5788v3qAh4H26y4a7Y1v3bILgFCTD4sdD2yk1xZhlsmjtaTgkOUNWHldneSgKO9Xouo3ScCaY8y1hXG8mNVrcdT66npeh8D58Eqjk6aBJoCuj1M953id3plpcoRs5SzGAGFjl9uF2ws0q3zAwEUGrVzDVTt2pbLaYqPRwqS3wCB+Qwf7mjXbbFaimO1dPU+p02+b6iozbStetLx4D6oinC4cygeezLpJXQ/wzZY0qdlpiI2PVbANEy+p/Pr3jhGX9bZCSxQgdoUMtDGXxbDINeLjkInahIiKlLvpqNzvwJmgwfq011ox5jKk+4yY6KfH3JWAYtBbWpVRT9O2LId1pBbm7jpP3QPSq7imreiLYqlSx9qpCVAebkWNxOmRLPVkSedAdSQEk41hpn9aJog== 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-20230913. The first 4 patches of the series are modifications currently going into the mm tree that modify the same area, or fix BUGs hit easily when exercising this series. They are not directly related to the batching changes. Patch 5 (hugetlb: optimize update_and_free_pages_bulk to avoid lock cycles) is where batching changes begin. 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 Johannes Weiner (1): mm: page_alloc: remove pcppage migratetype caching fix 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: 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 | 288 ++++++++++++++++++++++++++++++++----------- mm/hugetlb_vmemmap.c | 255 ++++++++++++++++++++++++++++++++------ mm/hugetlb_vmemmap.h | 16 +++ mm/page_alloc.c | 3 - 4 files changed, 452 insertions(+), 110 deletions(-)