All of lore.kernel.org
 help / color / mirror / Atom feed
* [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
  2026-11-16 12:52 ` [LTP] [PATCH] " Cyril Hrubis
  0 siblings, 2 replies; 4+ 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] 4+ messages in thread

end of thread, other threads:[~2026-11-18  2:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2026-11-16 12:52 ` [LTP] [PATCH] " Cyril Hrubis
2026-11-18  2:02   ` Huaisheng Ye

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.