From: Wenjie Xu Date: Thu, 15 May 2025 11:42:31 +0000 (+0800) Subject: hugetlb: show nr_huge_pages in report_hugepages() X-Git-Tag: v6.16-rc1~73^2~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3aefb1f06994ebbd94b7b2e5bf9cc3fecbd3eb39;p=thirdparty%2Flinux.git hugetlb: show nr_huge_pages in report_hugepages() The number of pre-allocated huge pages should be nr_huge_pages, not free_huge_pages, although they are same during booting stage Link: https://lkml.kernel.org/r/20250515114231.65824-1-xuwenjie04@baidu.com Signed-off-by: Wenjie Xu Signed-off-by: Li RongQing Acked-by: Oscar Salvador Cc: Muchun Song Signed-off-by: Andrew Morton --- diff --git a/mm/hugetlb.c b/mm/hugetlb.c index d53caf96a4b28..5a0bf1ea48f96 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3733,7 +3733,7 @@ static void __init report_hugepages(void) string_get_size(huge_page_size(h), 1, STRING_UNITS_2, buf, 32); pr_info("HugeTLB: registered %s page size, pre-allocated %ld pages\n", - buf, h->free_huge_pages); + buf, h->nr_huge_pages); if (nrinvalid) pr_info("HugeTLB: %s page size: %lu invalid page%s discarded\n", buf, nrinvalid, nrinvalid > 1 ? "s" : "");