Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/2219942/?format=api
{ "id": 2219942, "url": "http://patchwork.ozlabs.org/api/1.2/patches/2219942/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260405125240.2558577-18-songmuchun@bytedance.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/1.2/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20260405125240.2558577-18-songmuchun@bytedance.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20260405125240.2558577-18-songmuchun@bytedance.com/", "date": "2026-04-05T12:52:08", "name": "[17/49] mm: remove sparse_vmemmap_init_nid_late()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "6264ff09900ad9117f8a9dd1d819d879746aaa96", "submitter": { "id": 78930, "url": "http://patchwork.ozlabs.org/api/1.2/people/78930/?format=api", "name": "Muchun Song", "email": "songmuchun@bytedance.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20260405125240.2558577-18-songmuchun@bytedance.com/mbox/", "series": [ { "id": 498783, "url": "http://patchwork.ozlabs.org/api/1.2/series/498783/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=498783", "date": "2026-04-05T12:51:51", "name": "mm: Generalize vmemmap optimization for DAX and HugeTLB", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/498783/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2219942/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2219942/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linuxppc-dev+bounces-19347-incoming=patchwork.ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=hTwGp1x8;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=linuxppc-dev+bounces-19347-incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=patchwork.ozlabs.org)", "lists.ozlabs.org;\n arc=none smtp.remote-ip=\"2607:f8b0:4864:20::1035\"", "lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=bytedance.com", "lists.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=hTwGp1x8;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=bytedance.com\n (client-ip=2607:f8b0:4864:20::1035; helo=mail-pj1-x1035.google.com;\n envelope-from=songmuchun@bytedance.com; receiver=lists.ozlabs.org)" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fpXW052Qnz1yD3\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 05 Apr 2026 22:55:24 +1000 (AEST)", "from boromir.ozlabs.org (localhost [127.0.0.1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4fpXVq3cJtz2yrQ;\n\tSun, 05 Apr 2026 22:55:15 +1000 (AEST)", "from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com\n [IPv6:2607:f8b0:4864:20::1035])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 4fpXVp4hNBz2yrS\n\tfor <linuxppc-dev@lists.ozlabs.org>; Sun, 05 Apr 2026 22:55:14 +1000 (AEST)", "by mail-pj1-x1035.google.com with SMTP id\n 98e67ed59e1d1-35d9c7bf9a1so2804712a91.3\n for <linuxppc-dev@lists.ozlabs.org>;\n Sun, 05 Apr 2026 05:55:14 -0700 (PDT)", "from n232-176-004.byted.org ([36.110.163.97])\n by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-35de66b4808sm3748505a91.2.2026.04.05.05.55.06\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 05 Apr 2026 05:55:12 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1775393715;\n\tcv=none;\n b=ToYEahniE+uOaPMhs/vG65coZDLDuBHliCyP6S14ju+mPHchfxMgkEpLuGg2uGSO13kMzRFwhXrghn/oYRURKuoAprRRtQqacoR6ZOraJOxDwGMKoD3M74bOUZR0pe7sLmXOH1GFlE8iDINnFLuxCMcddZqH6f/nRsz99MYU+/KAxdztcx88M9SnL3+hPEBW2IWq3k5WmM5vvUuT/K38ZW3RQXwX17e5cVUeGqj28dMCaWmNyAJssMTaHuerplVJE3ZO+EQSheIEepnk1PQnn0rDLasMOJL4PQm1WwiijqEf572sPaGrzIDZAa7DKY27zSVrNLuyvH4XCK41S/1kQQ==", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707;\n\tt=1775393715; c=relaxed/relaxed;\n\tbh=KKli8yHSnxAMZ2GmFUDAbnEpbh1w6hBHm6LRjyjJACk=;\n\th=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:\n\t MIME-Version;\n b=PIzYd0sPNPgIg15HgwRNv1Jayv8U49OTaaCROxokdFTHi5SPW66LZ/ALoCHHxYEVxMXEgKYuonzPreZl3hcm0Y5bdkSLhGr+CmUdJD2cIzR9QpLT353t9y0yWPN5SiRAS0J0ckJd2Ly2QaIfshI62an58SzPDY8mvy7uD+gVrSOEzESrKpyBH+XC6wUOiod+GgFLyzDOYZEtnnQ8LW11ioHHn9ktFi47zVmGfdP6qNZX4K7yQiCwnDT6B0RHOkEvdkN9pD5b3IDB5AEAOUA9b6XFE2fBLD7sGX/6sgmDjdbZK1k5snLRztBHzhah0p2T/9htAVk0k/IMacCR8DrZig==", "ARC-Authentication-Results": "i=1; lists.ozlabs.org;\n dmarc=pass (p=quarantine dis=none) header.from=bytedance.com;\n dkim=pass (2048-bit key;\n unprotected) header.d=bytedance.com header.i=@bytedance.com\n header.a=rsa-sha256 header.s=google header.b=hTwGp1x8; dkim-atps=neutral;\n spf=pass (client-ip=2607:f8b0:4864:20::1035; helo=mail-pj1-x1035.google.com;\n envelope-from=songmuchun@bytedance.com;\n receiver=lists.ozlabs.org) smtp.mailfrom=bytedance.com", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=bytedance.com; s=google; t=1775393713; x=1775998513;\n darn=lists.ozlabs.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=KKli8yHSnxAMZ2GmFUDAbnEpbh1w6hBHm6LRjyjJACk=;\n b=hTwGp1x85OGfAUTgMlU7Ep57TkoTbkLFTDXlQ8LHo2zcizTn0sU8lAwf5JGA7Gdv5b\n 95bFMzeIq4iIWhAHIOsUGDCWDMSWlwGQeqgYU2m1PrEupaQ7dgSjUoz31i1NS3Ip8ZHP\n rS8sf3ivLQGrhMG0TycaKB+2qJsXUNZULwKqIcvhN0b/moVjKkWv2HAOvyrKocIj0o54\n zvYvpTW13XgEyM8iZP2YTkH0vajlrCg1AgY6ufsyx1jkJfK0OjzDgdWhaXbvGqI68Svz\n 80DeZpV6bFwpCsoI6+9SIP8D0ym9TIjzsyQFALzP5ukTUH6tHOZNm+Tez4Uyb9acnEKI\n bUHg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775393713; x=1775998513;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=KKli8yHSnxAMZ2GmFUDAbnEpbh1w6hBHm6LRjyjJACk=;\n b=LWMK2Mz0ybH7JtnZ1BYw5gsA32Uz0gYgkE9kb9zZwt0KdGdUxfc1NBLVBgjwqbSJuA\n 07vxSESuw1Xb0Uj+jxLhc0XondE57NlfPYjB3k/R/Tsqa4PDr3xhW5n+dGZ1DUcxO4C7\n /y3rd+flwZq3dh8qAZ9iFIRLC+GsHuDv2LqbE6thn6lRvLb9OwnIPtrtei/iJUf44lFV\n f/NQWzAAOIriCF1s5crP2oF85TxNXzmt+w0g2gRFurl3Hi0cgpz4VYMoI7Vitlk1X57/\n rV12RugFF6m+yof8OeAf3Il0FE/dJNs/mF5Jsi3lMEpXaYIOKM3nC5yzs6NJ/JXzVd0w\n Ovxw==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCUpVhK4Qc0Ovlhylr5QZ3y/920HVrZcSCX9nnZfJRiHAw/sOXH9dccJAR2LgQ0k4TKSq6lv0e5oOOHYiH8=@lists.ozlabs.org", "X-Gm-Message-State": "AOJu0YyBFk/5SqTWpQ7v+GzXwbEaUkLY4kJQkkUYYr0S9nxFB3eQRSgG\n\tu7Kfjlhan1MdoohyleyXUuSdRuSECXQT3+rG785v/t0Bi/XOxoLY5RHbLSpYXDOPDLM=", "X-Gm-Gg": "AeBDiesjkpJYojO6OIUjRRU2Kw4uE7M+B0iE7c6+Rnq61SRHH+K3ns1HyPzJhDi/R4b\n\tKuPOangIs2PAeEV/tOzAMitClW+vu92By+V2/7Ld7Z8mD7Gz6OucvNtEE8TBzk6vk4f20B7o9Jf\n\tO7dsX587rVfB7B0vm8TykGwhrNj1j5I0+O3dHarIxWK1h4lhxk4YWCdt1ujmTKDGe96AELpLDwa\n\tQsq/tT2ZJKpXOoPPJVvpL3ZRa5S88ACSSp1J9J+kGezmvLy9PYRqcez4a4EjT2k0P6+JWUJwmtG\n\tEHJCYX4dB8tm1zTBLS5egzAEnie27JXL56+v+Xsk4xyv0fG2g9Kwzy1zZHiYf94lIk92QpKnKcb\n\tw1YXW/sVTaOoOVhVOHXqFQrkix08ft0wse8tR2rFLnbOuqvIEXCkKBhk1SQYwJCNTfJnCC6Tmse\n\t5qrgk8/+V9Ga6YIy4shJTwbJFlvrCcB1GbRYSfSCqIjpaBlu/nEpwg/w==", "X-Received": "by 2002:a17:90b:224e:b0:35d:a90d:580e with SMTP id\n 98e67ed59e1d1-35de693d12amr8416296a91.23.1775393712638;\n Sun, 05 Apr 2026 05:55:12 -0700 (PDT)", "From": "Muchun Song <songmuchun@bytedance.com>", "To": "Andrew Morton <akpm@linux-foundation.org>,\n\tDavid Hildenbrand <david@kernel.org>,\n\tMuchun Song <muchun.song@linux.dev>,\n\tOscar Salvador <osalvador@suse.de>,\n\tMichael Ellerman <mpe@ellerman.id.au>,\n\tMadhavan Srinivasan <maddy@linux.ibm.com>", "Cc": "Lorenzo Stoakes <ljs@kernel.org>,\n\t\"Liam R . Howlett\" <Liam.Howlett@oracle.com>,\n\tVlastimil Babka <vbabka@kernel.org>,\n\tMike Rapoport <rppt@kernel.org>,\n\tSuren Baghdasaryan <surenb@google.com>,\n\tMichal Hocko <mhocko@suse.com>,\n\tNicholas Piggin <npiggin@gmail.com>,\n\tChristophe Leroy <chleroy@kernel.org>,\n\taneesh.kumar@linux.ibm.com,\n\tjoao.m.martins@oracle.com,\n\tlinux-mm@kvack.org,\n\tlinuxppc-dev@lists.ozlabs.org,\n\tlinux-kernel@vger.kernel.org,\n\tMuchun Song <songmuchun@bytedance.com>", "Subject": "[PATCH 17/49] mm: remove sparse_vmemmap_init_nid_late()", "Date": "Sun, 5 Apr 2026 20:52:08 +0800", "Message-Id": "<20260405125240.2558577-18-songmuchun@bytedance.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20260405125240.2558577-1-songmuchun@bytedance.com>", "References": "<20260405125240.2558577-1-songmuchun@bytedance.com>", "X-Mailing-List": "linuxppc-dev@lists.ozlabs.org", "List-Id": "<linuxppc-dev.lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev+help@lists.ozlabs.org>", "List-Owner": "<mailto:linuxppc-dev+owner@lists.ozlabs.org>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Archive": "<https://lore.kernel.org/linuxppc-dev/>,\n <https://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Subscribe": "<mailto:linuxppc-dev+subscribe@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-digest@lists.ozlabs.org>,\n <mailto:linuxppc-dev+subscribe-nomail@lists.ozlabs.org>", "List-Unsubscribe": "<mailto:linuxppc-dev+unsubscribe@lists.ozlabs.org>", "Precedence": "list", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Spam-Status": "No, score=-0.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID,\n\tDKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS\n\tautolearn=disabled version=4.0.1 OzLabs 8", "X-Spam-Checker-Version": "SpamAssassin 4.0.1 (2024-03-25) on lists.ozlabs.org" }, "content": "After deferring hugetlb bootmem allocation until after free_area_init()\nand checking cross-zone pages during allocation, the hugetlb_vmemmap_init_late()\nfunction is no longer needed:\n\n1. hugetlb_bootmem_alloc() is now called after free_area_init(), so zone\n information is available during bootmem huge page allocation.\n2. During alloc_bootmem(), cross-zone pages are identified and marked with\n HUGE_BOOTMEM_ZONES_VALID flag.\n3. After allocation, hugetlb_free_cross_zone_pages() frees those pages that\n intersect multiple zones.\n\nSince cross-zone pages are already handled in the allocation path, the late-stage\nvalidation in hugetlb_vmemmap_init_late() is redundant and can be removed.\n\nAlso, the sparse_vmemmap_init_nid_late() function is now empty and unused.\nRemove it to clean up the code.\n\nSigned-off-by: Muchun Song <songmuchun@bytedance.com>\n---\n include/linux/hugetlb.h | 2 --\n include/linux/mmzone.h | 7 -----\n mm/hugetlb.c | 70 -----------------------------------------\n mm/hugetlb_vmemmap.c | 58 ----------------------------------\n mm/hugetlb_vmemmap.h | 5 ---\n mm/sparse-vmemmap.c | 11 -------\n mm/sparse.c | 2 --\n 7 files changed, 155 deletions(-)", "diff": "diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h\nindex 9c098a02a09e..23d95ed6121f 100644\n--- a/include/linux/hugetlb.h\n+++ b/include/linux/hugetlb.h\n@@ -699,8 +699,6 @@ struct huge_bootmem_page {\n #define HUGE_BOOTMEM_ZONES_VALID\t0x0002\n #define HUGE_BOOTMEM_CMA\t\t0x0004\n \n-bool hugetlb_bootmem_page_zones_valid(int nid, struct huge_bootmem_page *m);\n-\n int isolate_or_dissolve_huge_folio(struct folio *folio, struct list_head *list);\n int replace_free_hugepage_folios(unsigned long start_pfn, unsigned long end_pfn);\n void wait_for_freed_hugetlb_folios(void);\ndiff --git a/include/linux/mmzone.h b/include/linux/mmzone.h\nindex a071f1a0e242..8ee9dc60120a 100644\n--- a/include/linux/mmzone.h\n+++ b/include/linux/mmzone.h\n@@ -2153,8 +2153,6 @@ static inline int preinited_vmemmap_section(const struct mem_section *section)\n }\n \n void sparse_vmemmap_init_nid_early(int nid);\n-void sparse_vmemmap_init_nid_late(int nid);\n-\n #else\n static inline int preinited_vmemmap_section(const struct mem_section *section)\n {\n@@ -2163,10 +2161,6 @@ static inline int preinited_vmemmap_section(const struct mem_section *section)\n static inline void sparse_vmemmap_init_nid_early(int nid)\n {\n }\n-\n-static inline void sparse_vmemmap_init_nid_late(int nid)\n-{\n-}\n #endif\n \n static inline int online_section_nr(unsigned long nr)\n@@ -2371,7 +2365,6 @@ static inline unsigned long next_present_section_nr(unsigned long section_nr)\n \n #else\n #define sparse_vmemmap_init_nid_early(_nid) do {} while (0)\n-#define sparse_vmemmap_init_nid_late(_nid) do {} while (0)\n #define pfn_in_present_section pfn_valid\n #endif /* CONFIG_SPARSEMEM */\n \ndiff --git a/mm/hugetlb.c b/mm/hugetlb.c\nindex 238495fd04e4..a00c9f3672b7 100644\n--- a/mm/hugetlb.c\n+++ b/mm/hugetlb.c\n@@ -58,7 +58,6 @@ struct hstate hstates[HUGE_MAX_HSTATE];\n \n __initdata nodemask_t hugetlb_bootmem_nodes;\n __initdata struct list_head huge_boot_pages[MAX_NUMNODES];\n-static unsigned long hstate_boot_nrinvalid[HUGE_MAX_HSTATE] __initdata;\n \n /*\n * Due to ordering constraints across the init code for various\n@@ -3254,57 +3253,6 @@ static void __init prep_and_add_bootmem_folios(struct hstate *h,\n \t}\n }\n \n-bool __init hugetlb_bootmem_page_zones_valid(int nid,\n-\t\t\t\t\t struct huge_bootmem_page *m)\n-{\n-\tunsigned long start_pfn;\n-\tbool valid;\n-\n-\tif (m->flags & HUGE_BOOTMEM_ZONES_VALID) {\n-\t\t/*\n-\t\t * Already validated, skip check.\n-\t\t */\n-\t\treturn true;\n-\t}\n-\n-\tif (hugetlb_bootmem_page_earlycma(m)) {\n-\t\tvalid = cma_validate_zones(m->cma);\n-\t\tgoto out;\n-\t}\n-\n-\tstart_pfn = virt_to_phys(m) >> PAGE_SHIFT;\n-\n-\tvalid = !pfn_range_intersects_zones(nid, start_pfn,\n-\t\t\tpages_per_huge_page(m->hstate));\n-out:\n-\tif (!valid)\n-\t\thstate_boot_nrinvalid[hstate_index(m->hstate)]++;\n-\n-\treturn valid;\n-}\n-\n-/*\n- * Free a bootmem page that was found to be invalid (intersecting with\n- * multiple zones).\n- *\n- * Since it intersects with multiple zones, we can't just do a free\n- * operation on all pages at once, but instead have to walk all\n- * pages, freeing them one by one.\n- */\n-static void __init hugetlb_bootmem_free_invalid_page(int nid, struct page *page,\n-\t\t\t\t\t struct hstate *h)\n-{\n-\tunsigned long npages = pages_per_huge_page(h);\n-\tunsigned long pfn;\n-\n-\twhile (npages--) {\n-\t\tpfn = page_to_pfn(page);\n-\t\t__init_page_from_nid(pfn, nid);\n-\t\tfree_reserved_page(page);\n-\t\tpage++;\n-\t}\n-}\n-\n /*\n * Put bootmem huge pages into the standard lists after mem_map is up.\n * Note: This only applies to gigantic (order > MAX_PAGE_ORDER) pages.\n@@ -3320,17 +3268,6 @@ static void __init gather_bootmem_prealloc_node(unsigned long nid)\n \t\tstruct folio *folio = (void *)page;\n \n \t\th = m->hstate;\n-\t\tif (!hugetlb_bootmem_page_zones_valid(nid, m)) {\n-\t\t\t/*\n-\t\t\t * Can't use this page. Initialize the\n-\t\t\t * page structures if that hasn't already\n-\t\t\t * been done, and give them to the page\n-\t\t\t * allocator.\n-\t\t\t */\n-\t\t\thugetlb_bootmem_free_invalid_page(nid, page, h);\n-\t\t\tcontinue;\n-\t\t}\n-\n \t\t/*\n \t\t * It is possible to have multiple huge page sizes (hstates)\n \t\t * in this list. If so, process each size separately.\n@@ -3700,20 +3637,13 @@ static void __init hugetlb_init_hstates(void)\n static void __init report_hugepages(void)\n {\n \tstruct hstate *h;\n-\tunsigned long nrinvalid;\n \n \tfor_each_hstate(h) {\n \t\tchar buf[32];\n \n-\t\tnrinvalid = hstate_boot_nrinvalid[hstate_index(h)];\n-\t\th->max_huge_pages -= nrinvalid;\n-\n \t\tstring_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, 32);\n \t\tpr_info(\"HugeTLB: registered %s page size, pre-allocated %ld pages\\n\",\n \t\t\tbuf, h->nr_huge_pages);\n-\t\tif (nrinvalid)\n-\t\t\tpr_info(\"HugeTLB: %s page size: %lu invalid page%s discarded\\n\",\n-\t\t\t\t\tbuf, nrinvalid, str_plural(nrinvalid));\n \t\tpr_info(\"HugeTLB: %d KiB vmemmap can be freed for a %s page\\n\",\n \t\t\thugetlb_vmemmap_optimizable_size(h) / SZ_1K, buf);\n \t}\ndiff --git a/mm/hugetlb_vmemmap.c b/mm/hugetlb_vmemmap.c\nindex e25c70453928..535f0369a496 100644\n--- a/mm/hugetlb_vmemmap.c\n+++ b/mm/hugetlb_vmemmap.c\n@@ -807,64 +807,6 @@ void __init hugetlb_vmemmap_init_early(int nid)\n \t\tm->flags |= HUGE_BOOTMEM_HVO;\n \t}\n }\n-\n-void __init hugetlb_vmemmap_init_late(int nid)\n-{\n-\tstruct huge_bootmem_page *m, *tm;\n-\tunsigned long phys, nr_pages, start, end;\n-\tunsigned long pfn, nr_mmap;\n-\tstruct zone *zone = NULL;\n-\tstruct hstate *h;\n-\tvoid *map;\n-\n-\tif (!READ_ONCE(vmemmap_optimize_enabled))\n-\t\treturn;\n-\n-\tlist_for_each_entry_safe(m, tm, &huge_boot_pages[nid], list) {\n-\t\tif (!(m->flags & HUGE_BOOTMEM_HVO))\n-\t\t\tcontinue;\n-\n-\t\tphys = virt_to_phys(m);\n-\t\th = m->hstate;\n-\t\tpfn = PHYS_PFN(phys);\n-\t\tnr_pages = pages_per_huge_page(h);\n-\t\tmap = pfn_to_page(pfn);\n-\t\tstart = (unsigned long)map;\n-\t\tend = start + nr_pages * sizeof(struct page);\n-\n-\t\tif (!hugetlb_bootmem_page_zones_valid(nid, m)) {\n-\t\t\t/*\n-\t\t\t * Oops, the hugetlb page spans multiple zones.\n-\t\t\t * Remove it from the list, and populate it normally.\n-\t\t\t */\n-\t\t\tlist_del(&m->list);\n-\n-\t\t\tvmemmap_populate(start, end, nid, NULL, NULL);\n-\t\t\tnr_mmap = end - start;\n-\t\t\tmemmap_boot_pages_add(DIV_ROUND_UP(nr_mmap, PAGE_SIZE));\n-\n-\t\t\tmemblock_phys_free(phys, huge_page_size(h));\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\tif (!zone || !zone_spans_pfn(zone, pfn))\n-\t\t\tzone = pfn_to_zone(nid, pfn);\n-\t\tif (WARN_ON_ONCE(!zone))\n-\t\t\tcontinue;\n-\n-\t\tif (vmemmap_populate_hvo(start, end, huge_page_order(h), zone,\n-\t\t\t\t\t HUGETLB_VMEMMAP_RESERVE_SIZE) < 0) {\n-\t\t\t/* Fallback if HVO population fails */\n-\t\t\tvmemmap_populate(start, end, nid, NULL, NULL);\n-\t\t\tnr_mmap = end - start;\n-\t\t} else {\n-\t\t\tm->flags |= HUGE_BOOTMEM_ZONES_VALID;\n-\t\t\tnr_mmap = HUGETLB_VMEMMAP_RESERVE_SIZE;\n-\t\t}\n-\n-\t\tmemmap_boot_pages_add(DIV_ROUND_UP(nr_mmap, PAGE_SIZE));\n-\t}\n-}\n #endif\n \n static const struct ctl_table hugetlb_vmemmap_sysctls[] = {\ndiff --git a/mm/hugetlb_vmemmap.h b/mm/hugetlb_vmemmap.h\nindex 18b490825215..7ac49c52457d 100644\n--- a/mm/hugetlb_vmemmap.h\n+++ b/mm/hugetlb_vmemmap.h\n@@ -29,7 +29,6 @@ void hugetlb_vmemmap_optimize_folios(struct hstate *h, struct list_head *folio_l\n void hugetlb_vmemmap_optimize_bootmem_folios(struct hstate *h, struct list_head *folio_list);\n #ifdef CONFIG_SPARSEMEM_VMEMMAP_PREINIT\n void hugetlb_vmemmap_init_early(int nid);\n-void hugetlb_vmemmap_init_late(int nid);\n #endif\n \n \n@@ -81,10 +80,6 @@ static inline void hugetlb_vmemmap_init_early(int nid)\n {\n }\n \n-static inline void hugetlb_vmemmap_init_late(int nid)\n-{\n-}\n-\n static inline unsigned int hugetlb_vmemmap_optimizable_size(const struct hstate *h)\n {\n \treturn 0;\ndiff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c\nindex b7201c235419..26cb55c12a83 100644\n--- a/mm/sparse-vmemmap.c\n+++ b/mm/sparse-vmemmap.c\n@@ -581,17 +581,6 @@ void __init sparse_vmemmap_init_nid_early(int nid)\n {\n \thugetlb_vmemmap_init_early(nid);\n }\n-\n-/*\n- * This is called just before the initialization of page structures\n- * through memmap_init. Zones are now initialized, so any work that\n- * needs to be done that needs zone information can be done from\n- * here.\n- */\n-void __init sparse_vmemmap_init_nid_late(int nid)\n-{\n-\thugetlb_vmemmap_init_late(nid);\n-}\n #endif\n \n static void subsection_mask_set(unsigned long *map, unsigned long pfn,\ndiff --git a/mm/sparse.c b/mm/sparse.c\nindex d940b973df66..5fe0a7e66775 100644\n--- a/mm/sparse.c\n+++ b/mm/sparse.c\n@@ -383,8 +383,6 @@ static void __init sparse_init_nid(int nid, unsigned long pnum_begin,\n \t}\n \tsparse_usage_fini();\n \tsparse_buffer_fini();\n-\n-\tsparse_vmemmap_init_nid_late(nid);\n }\n \n /*\n", "prefixes": [ "17/49" ] }