[LTP] [PATCH] hugemmap10: Add linux-git tag for NUMA fix
Huaisheng Ye
yehuaisheng@open-hieco.net
Mon Nov 16 11:15:59 CET 2026
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
More information about the ltp
mailing list