From: sashiko-bot@kernel.org
To: "Enze Li" <lienze@kylinos.cn>,
muchun.song@linux.dev, osalvador@suse.de, david@kernel.org,
akpm@linux-foundation.org, corbet@lwn.net
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] docs: hugetlbpage.rst: clarify HugePages_Total in hugetlbpage.rst
Date: Sat, 24 Oct 2026 10:10:10 +0000 [thread overview]
Message-ID: <sashiko-outbox-183640@kernel.org> (raw)
In-Reply-To: <20261023100859.70744-1-lienze@kylinos.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] docs: hugetlb: HugePages_Total falsely documented as persistent page count
--
commit 7d6d3b965cd5f08c4d5dcbd9da32baf62e0f76e3
Author: Enze Li <lienze@kylinos.cn>
docs: hugetlbpage.rst: clarify HugePages_Total in hugetlbpage.rst
This commit updates the description of HugePages_Total in
Documentation/admin-guide/mm/hugetlbpage.rst to clarify that it reports a
page count for the default huge page size and points readers to
/sys/kernel/mm/hugepages for other huge page sizes.
> diff --git a/Documentation/admin-guide/mm/hugetlbpage.rst b/Documentation/admin-guide/mm/hugetlbpage.rst
> index 2075f1f14a421..01fa9f61c9a92 100644
> --- a/Documentation/admin-guide/mm/hugetlbpage.rst
> +++ b/Documentation/admin-guide/mm/hugetlbpage.rst
> @@ -43,7 +43,9 @@ The output of ``cat /proc/meminfo`` will include lines like::
> where:
>
> HugePages_Total
> - is the size of the pool of huge pages.
> + is the number of persistent huge pages of the default size
> + in the pool. Pools of other huge page sizes are not shown
> + here; see ``/sys/kernel/mm/hugepages`` described below.
[Severity: Low]
Is it accurate to describe HugePages_Total as the number of persistent huge
pages?
In mm/hugetlb.c, hugetlb_report_meminfo() prints h->nr_huge_pages for
default_hstate:
for_each_hstate(h) {
unsigned long count = h->nr_huge_pages;
total += huge_page_size(h) * count;
if (h == &default_hstate)
seq_printf(m,
"HugePages_Total: %5lu\n"
"HugePages_Free: %5lu\n"
"HugePages_Rsvd: %5lu\n"
"HugePages_Surp: %5lu\n"
"Hugepagesize: %8lu kB\n",
count,
h->free_huge_pages,
h->resv_huge_pages,
h->surplus_huge_pages,
huge_page_size(h) / SZ_1K);
}
However, h->nr_huge_pages includes both persistent and surplus huge pages, as
shown by persistent_huge_pages() and alloc_surplus_hugetlb_folio() in
mm/hugetlb.c:
#define persistent_huge_pages(h) (h->nr_huge_pages - h->surplus_huge_pages)
alloc_surplus_hugetlb_folio()
account_new_hugetlb_folio(h, folio)
h->nr_huge_pages++;
h->surplus_huge_pages++;
Should this say "is the number of huge pages of the default size in the pool"
(or note that it includes both persistent and surplus huge pages) rather than
restricting it to persistent huge pages?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261023100859.70744-1-lienze@kylinos.cn?part=1
next prev parent reply other threads:[~2026-10-24 10:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 10:08 [PATCH] docs: hugetlbpage.rst: clarify HugePages_Total in hugetlbpage.rst Enze Li
2026-10-24 10:10 ` sashiko-bot [this message]
2026-10-25 13:25 ` Daniel Pereira
[not found] ` <1792998249167036.77.seg@mailgw.kylinos.cn>
2026-10-26 7:47 ` Enze Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-183640@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=corbet@lwn.net \
--cc=david@kernel.org \
--cc=lienze@kylinos.cn \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox