All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 0/3] hugemmap10: Add NUMA hugetlb regression test
@ 2026-11-23  8:05 Huaisheng Ye
  2026-11-23  8:05 ` [LTP] [PATCH v2 1/3] hugemmap10: Add linux-git tag for NUMA fix Huaisheng Ye
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Huaisheng Ye @ 2026-11-23  8:05 UTC (permalink / raw)
  To: li.wang, chrubis, pvorel; +Cc: ltp

The existing hugemmap10 counter test does not reliably exercise the
hugetlb NUMA regression fixed by Linux commit
21f514ad520459fbfa58ccdf171bb68148c2f5aa. Free hugepages may be
available globally but located outside the nodes allowed by the task's
memory policy, so the test needs to establish this state explicitly.

Add a NUMA subtest which binds the task to the second memory node, keeps
free hugepages on the first node, and reuses the existing counter-test
sequence for base pool sizes from zero through three. The original test
continues to run unchanged as the default subtest.

Changes since v1:

  - Move the regression description and reproduction command into the
    existing LTP documentation comment so they are exported properly.
  - Add a separate NUMA subtest instead of relying on an externally
    configured numactl environment.
  - Reuse the original five mapping scenarios and base pool sizes 0-3,
    while skipping only the NUMA subtest when its prerequisites cannot
    be established.
  - Save and restore the inherited memory policy and the affected
    per-node persistent hugepage pools.
  - Split the NUMA test implementation and its diagnostic logging into
    separate patches.

v1: https://lore.kernel.org/ltp/20261116101559.93229-1-yehuaisheng@open-hieco.net/

Tested on a NUMA system:

  make -C testcases/kernel/mem/hugetlb/hugemmap hugemmap10
  ./hugemmap10 -D2
  ./hugemmap10 -D2 -n

The test completed with two passing subtests.

Huaisheng Ye (3):
  hugemmap10: Add linux-git tag for NUMA fix
  hugemmap10: Reuse counter tests with a NUMA bind policy
  hugemmap10: Add NUMA counter test diagnostics

 .../kernel/mem/hugetlb/hugemmap/hugemmap10.c  | 251 +++++++++++++++++-
 1 file changed, 239 insertions(+), 12 deletions(-)

-- 
2.52.0

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [LTP] [PATCH] hugemmap10: Add linux-git tag for NUMA fix
@ 2026-11-16 10:15 Huaisheng Ye
  2026-11-16 12:10 ` [LTP] " linuxtestproject.agent
  0 siblings, 1 reply; 6+ messages in thread
From: Huaisheng Ye @ 2026-11-16 10:15 UTC (permalink / raw)
  To: li.wang, chrubis, pvorel; +Cc: ltp

Tag Linux commit 21f514ad520459fbfa58ccdf171bb68148c2f5aa, which fixes
hugetlb mappings when free huge pages are outside the nodes allowed by the
task's cpuset or MPOL_BIND policy.

Before the fix, gathering surplus pages considered only global counters, so
mmap() could fail with ENOMEM even when nr_overcommit_hugepages allowed
surplus pages on the permitted nodes.

Document the regression and its NUMA reproduction command in the test.

Signed-off-by: Huaisheng Ye <yehuaisheng@open-hieco.net>
---
 .../kernel/mem/hugetlb/hugemmap/hugemmap10.c   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
index c66b07039..c3e0984d4 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
@@ -12,6 +12,20 @@
  * successful, the test passes.
  */
 
+/*
+ * This test also covers the NUMA regression fixed by Linux commit
+ * 21f514ad520459fbfa58ccdf171bb68148c2f5aa. If free huge pages are outside
+ * the nodes allowed by the task's cpuset or MPOL_BIND policy, hugetlb must
+ * account for the allowed-node shortfall when gathering surplus pages.
+ * Otherwise mmap() may fail with ENOMEM even when nr_overcommit_hugepages
+ * permits allocating surplus pages on the allowed nodes.
+ *
+ * The issue can be exercised on a system with two or more NUMA nodes, for
+ * example with:
+ *
+ *   numactl --cpunodebind=0 --membind=1 ./hugemmap10
+ */
+
 #define _GNU_SOURCE
 #include <errno.h>
 #include <linux/mempolicy.h>
@@ -602,6 +616,10 @@ static void cleanup(void)
 }
 
 static struct tst_test test = {
+	.tags = (struct tst_tag[]) {
+		{"linux-git", "21f514ad520459fbfa58ccdf171bb68148c2f5aa"},
+		{}
+	},
 	.needs_root = 1,
 	.options = (struct tst_option[]) {
 		{"n", &private_noreserve_opt,
-- 
2.52.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-23 20:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23  8:05 [LTP] [PATCH v2 0/3] hugemmap10: Add NUMA hugetlb regression test Huaisheng Ye
2026-11-23  8:05 ` [LTP] [PATCH v2 1/3] hugemmap10: Add linux-git tag for NUMA fix Huaisheng Ye
2026-11-23 20:43   ` [LTP] " linuxtestproject.agent
2026-11-23  8:05 ` [LTP] [PATCH v2 2/3] hugemmap10: Reuse counter tests with a NUMA bind policy Huaisheng Ye
2026-11-23  8:05 ` [LTP] [PATCH v2 3/3] hugemmap10: Add NUMA counter test diagnostics Huaisheng Ye
  -- strict thread matches above, loose matches on Subject: below --
2026-11-16 10:15 [LTP] [PATCH] hugemmap10: Add linux-git tag for NUMA fix Huaisheng Ye
2026-11-16 12:10 ` [LTP] " linuxtestproject.agent

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.