* Re: [LTP] hugemmap10: Add linux-git tag for NUMA fix
2026-11-16 10:15 [LTP] [PATCH] hugemmap10: Add linux-git tag for NUMA fix Huaisheng Ye
@ 2026-11-16 12:10 ` linuxtestproject.agent
0 siblings, 0 replies; 6+ messages in thread
From: linuxtestproject.agent @ 2026-11-16 12:10 UTC (permalink / raw)
To: Huaisheng Ye; +Cc: ltp
Hi Huaisheng,
On Mon, Nov 16, 2026 at 06:15:59PM +0800, Huaisheng Ye wrote:
> hugemmap10: Add linux-git tag for NUMA fix
Verdict - Reviewed
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* [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 v2 1/3] hugemmap10: Add linux-git tag for NUMA fix
2026-11-23 8:05 [LTP] [PATCH v2 0/3] hugemmap10: Add NUMA hugetlb regression test Huaisheng Ye
@ 2026-11-23 8:05 ` 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
2 siblings, 1 reply; 6+ messages in thread
From: Huaisheng Ye @ 2026-11-23 8:05 UTC (permalink / raw)
To: li.wang, chrubis, pvorel; +Cc: ltp
Tag Linux commit 21f514ad5204 ("mm/hugetlb: account for allowed nodes
when gathering surplus pages"), 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, gather_surplus_pages() considered only global counters.
As a result, mmap() could fail with ENOMEM even when
nr_overcommit_hugepages allowed surplus pages on the permitted nodes.
Put the regression description and NUMA reproduction command in the
existing documentation comment so both are exported to documentation.
Signed-off-by: Huaisheng Ye <yehuaisheng@open-hieco.net>
---
.../kernel/mem/hugetlb/hugemmap/hugemmap10.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
index c66b07039..763f68e69 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
@@ -10,6 +10,18 @@
* Hugetlb counter (Total, Free, Reserve, Surplus) in /proc/meminfo and
* compare them with expected (calculated) value. if all checks are
* 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
@@ -602,6 +614,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
* [LTP] [PATCH v2 2/3] hugemmap10: Reuse counter tests with a NUMA bind policy
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 8:05 ` Huaisheng Ye
2026-11-23 8:05 ` [LTP] [PATCH v2 3/3] hugemmap10: Add NUMA counter test diagnostics Huaisheng Ye
2 siblings, 0 replies; 6+ messages in thread
From: Huaisheng Ye @ 2026-11-23 8:05 UTC (permalink / raw)
To: li.wang, chrubis, pvorel; +Cc: ltp
The allowed-node surplus regression is only exercised by the counter
tests when free hugepages are outside the task's memory policy. Running
hugemmap10 without an external NUMA setup does not ensure this coverage.
Add a second test case which selects the first two system memory nodes,
keeps free hugepages on the first and applies MPOL_BIND to the second.
Run the existing counter suite for both test cases, including all five
mapping scenarios and base pool sizes from zero through three.
Resize the bound node's pool through nr_hugepages_mempolicy, adding the
unchanged remote pool to the requested global persistent count. Account
for remote free pages when predicting pool shrinkage and the release of
unused surplus pages. The zero-size pool exercises surplus reservations
on an empty allowed node despite free hugepages elsewhere.
Check that the target can allocate three hugepages before testing. Skip
only the NUMA case when its prerequisites cannot be established. Report
mmap failures as TFAIL and one TPASS per completed counter suite.
Restore the inherited memory policy and affected node pools after each
iteration, with final cleanup covering partial setup and early failures.
Signed-off-by: Huaisheng Ye <yehuaisheng@open-hieco.net>
---
.../kernel/mem/hugetlb/hugemmap/hugemmap10.c | 224 ++++++++++++++++--
1 file changed, 208 insertions(+), 16 deletions(-)
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
index 763f68e69..4c36df789 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
@@ -18,10 +18,13 @@
* 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
+ * A separate subtest runs the same counter checks with MPOL_BIND on the
+ * second NUMA memory node. It varies that node's persistent pool from zero
+ * to three pages while keeping free pages on the first node. With an empty
+ * local pool, a mapping must allocate a surplus page on the bound node
+ * despite the free pages elsewhere.
+ * The subtest is skipped if the required NUMA or allocation conditions
+ * cannot be established; the original counter tests still run.
*/
#define _GNU_SOURCE
@@ -42,6 +45,9 @@
#define MNTPOINT "hugetlbfs/"
#define ULONG_BITS (sizeof(unsigned long) * CHAR_BIT)
+#define NODE_HUGEPAGES "/sys/devices/system/node/node%lu/hugepages/hugepages-%ldkB/%s"
+#define NR_HUGEPAGES_MEMPOLICY "/proc/sys/vm/nr_hugepages_mempolicy"
+#define MAX_BASE_POOL_SIZE 3
static long hpage_size;
static int private_resv;
@@ -60,6 +66,19 @@ static long prev_free;
static long prev_resv;
static long prev_surp;
+enum {
+ NUMA_SOURCE,
+ NUMA_TARGET,
+ NUMA_NODES,
+};
+
+static unsigned long numa_nodes[NUMA_NODES];
+static unsigned long numa_pool_sizes[NUMA_NODES];
+static unsigned long *numa_nodemask, *saved_nodemask;
+static unsigned long numa_maxnode;
+static long numa_remote_free;
+static int saved_policy, numa_policy_set, numa_pools_saved;
+
static void read_meminfo_huge(long *total, long *free, long *resv, long *surp)
{
*total = SAFE_READ_MEMINFO(MEMINFO_HPAGE_TOTAL);
@@ -295,7 +314,9 @@ static int set_nr_hugepages_(long count, char *desc, int line)
long min_size;
long et, ef, er, es;
- SAFE_FILE_PRINTF(PATH_VM_NR_HPAGES, "%lu", count);
+ count += numa_remote_free;
+ SAFE_FILE_PRINTF(numa_remote_free ? NR_HUGEPAGES_MEMPOLICY : PATH_VM_NR_HPAGES,
+ "%ld", count);
/* The code below is based on set_max_huge_pages in mm/hugetlb.c */
es = prev_surp;
@@ -325,7 +346,7 @@ static int set_nr_hugepages_(long count, char *desc, int line)
* to the desired size as pages become free.
*/
min_size = MAX(count, er + et - ef);
- while (min_size < et - es) {
+ while (min_size < et - es && ef > numa_remote_free) {
ef--;
et--;
}
@@ -342,14 +363,18 @@ static int map_(int s, int hpages, int flags, char *desc, int line)
unsigned long allowed_free = 0;
long et, ef, er, es;
int creates_reservation = mapping_creates_reservation(flags);
+ int mmap_flags = private_mmap_flags(flags);
map_fd[s] = tst_creat_unlinked(MNTPOINT, 0, 0600);
map_size[s] = hpages * hpage_size;
if (creates_reservation)
allowed_free = read_allowed_free_hugepages();
- map_addr[s] = SAFE_MMAP(NULL, map_size[s], PROT_READ|PROT_WRITE,
- private_mmap_flags(flags),
- map_fd[s], 0);
+ TESTPTR(mmap(NULL, map_size[s], PROT_READ | PROT_WRITE, mmap_flags, map_fd[s], 0));
+ if (TST_RET_PTR == MAP_FAILED) {
+ tst_res_(__FILE__, line, TFAIL | TTERRNO, "While %s: mmap() failed", desc);
+ return -1;
+ }
+ map_addr[s] = TST_RET_PTR;
touched[s] = 0;
et = prev_total;
@@ -417,6 +442,9 @@ static int unmap_(int s, int hpages, int flags, char *desc, int line)
if (mapping_creates_reservation(flags)) {
int unused_surplus = MIN(hpages - touched[s], es);
+ if (numa_remote_free)
+ unused_surplus = MIN(unused_surplus, ef - numa_remote_free);
+
et -= unused_surplus;
ef -= unused_surplus;
er -= hpages - touched[s];
@@ -515,7 +543,7 @@ static int test_counters(char *desc, int base_nr)
return -1;
/* Add pages once surplus is consumed */
- if (SET_NR_HUGEPAGES(MAX(base_nr, 3), "adding more pages after consuming surplus"))
+ if (SET_NR_HUGEPAGES(MAX(base_nr, MAX_BASE_POOL_SIZE), "adding more pages after consuming surplus"))
return -1;
/* Release free huge pages first */
@@ -543,8 +571,11 @@ static void per_iteration_cleanup(void)
prev_resv = 0;
prev_surp = 0;
for (nr = 0; nr < NR_SLOTS; nr++) {
- if (map_addr[nr])
+ if (map_addr[nr]) {
SAFE_MUNMAP(map_addr[nr], map_size[nr]);
+ map_addr[nr] = NULL;
+ map_size[nr] = 0;
+ }
if (map_fd[nr] != -1)
SAFE_CLOSE(map_fd[nr]);
}
@@ -586,17 +617,176 @@ static int test_per_base_nr(int base_nr)
return 0;
}
-static void run_test(void)
+static void run_counter_test(void)
{
int base_nr;
- for (base_nr = 0; base_nr <= 3; base_nr++) {
+ for (base_nr = 0; base_nr <= MAX_BASE_POOL_SIZE; base_nr++) {
if (test_per_base_nr(base_nr))
break;
}
- if (base_nr > 3)
- tst_res(TPASS, "Hugepages Counters works as expected.");
+ if (base_nr > MAX_BASE_POOL_SIZE)
+ tst_res(TPASS, "%s hugepage counters work as expected",
+ numa_remote_free ? "NUMA-bound" : "Default");
+}
+
+static unsigned long read_numa_hugepages(unsigned int index, const char *name)
+{
+ char path[PATH_MAX];
+ unsigned long pages;
+
+ snprintf(path, sizeof(path), NODE_HUGEPAGES, numa_nodes[index],
+ hpage_size / 1024, name);
+ SAFE_FILE_SCANF(path, "%lu", &pages);
+ return pages;
+}
+
+static int set_numa_hugepages(unsigned int index, unsigned long pages)
+{
+ char path[PATH_MAX];
+
+ snprintf(path, sizeof(path), NODE_HUGEPAGES, numa_nodes[index],
+ hpage_size / 1024, "nr_hugepages");
+ SAFE_FILE_PRINTF(path, "%lu", pages);
+ return read_numa_hugepages(index, "nr_hugepages") == pages;
+}
+
+static void restore_numa_state(void)
+{
+ unsigned int index;
+ int failed = 0;
+
+ if (!numa_policy_set && !numa_pools_saved &&
+ !numa_nodemask && !saved_nodemask)
+ return;
+
+ if (numa_policy_set) {
+ if (syscall(__NR_set_mempolicy, saved_policy, saved_nodemask,
+ numa_maxnode)) {
+ tst_res(TWARN | TERRNO, "Failed to restore memory policy");
+ failed = 1;
+ }
+ numa_policy_set = 0;
+ }
+
+ if (numa_pools_saved) {
+ for (index = 0; index < NUMA_NODES; index++) {
+ if (!set_numa_hugepages(index, numa_pool_sizes[index])) {
+ tst_res(TWARN, "Failed to restore node %lu hugepage pool",
+ numa_nodes[index]);
+ failed = 1;
+ }
+ }
+ numa_pools_saved = 0;
+ }
+
+ free(numa_nodemask);
+ numa_nodemask = NULL;
+ free(saved_nodemask);
+ saved_nodemask = NULL;
+ numa_remote_free = 0;
+
+ if (failed)
+ tst_brk(TBROK, "Failed to restore NUMA test state");
+}
+
+static int prepare_numa_test(void)
+{
+ char path[PATH_MAX];
+ char separator;
+ size_t mask_size = getpagesize();
+ unsigned int index;
+
+ numa_maxnode = mask_size * CHAR_BIT;
+ if (FILE_SCANF("/sys/devices/system/node/has_memory", "%lu%c%lu",
+ &numa_nodes[NUMA_SOURCE], &separator, &numa_nodes[NUMA_TARGET])) {
+ tst_res(TCONF, "NUMA subtest needs at least two memory nodes");
+ return 0;
+ }
+ if (separator == '-')
+ numa_nodes[NUMA_TARGET] = numa_nodes[NUMA_SOURCE] + 1;
+ if (numa_nodes[NUMA_TARGET] >= numa_maxnode) {
+ tst_res(TCONF, "NUMA node ID exceeds the nodemask capacity");
+ return 0;
+ }
+ if (access(NR_HUGEPAGES_MEMPOLICY, W_OK)) {
+ tst_res(TCONF | TERRNO, "Cannot resize hugepage pool using the NUMA policy");
+ return 0;
+ }
+
+ for (index = 0; index < NUMA_NODES; index++) {
+ snprintf(path, sizeof(path), NODE_HUGEPAGES, numa_nodes[index],
+ hpage_size / 1024, "nr_hugepages");
+ if (access(path, W_OK)) {
+ tst_res(TCONF, "Node %lu hugepage pool is not writable",
+ numa_nodes[index]);
+ return 0;
+ }
+ }
+
+ read_meminfo_huge(&prev_total, &prev_free, &prev_resv, &prev_surp);
+ if (prev_total != prev_free || prev_resv || prev_surp) {
+ tst_res(TCONF, "Cannot prepare NUMA subtest while hugepages are in use");
+ return 0;
+ }
+
+ numa_nodemask = SAFE_CALLOC(1, mask_size);
+ saved_nodemask = SAFE_CALLOC(1, mask_size);
+ if (syscall(__NR_get_mempolicy, &saved_policy, saved_nodemask,
+ numa_maxnode, NULL, 0)) {
+ if (errno != ENOSYS && errno != EPERM && errno != EACCES)
+ tst_brk(TBROK | TERRNO, "get_mempolicy() failed");
+ tst_res(TCONF | TERRNO, "NUMA memory policies are unavailable");
+ return 0;
+ }
+
+ node_set(numa_nodes[NUMA_TARGET], numa_nodemask);
+ if (syscall(__NR_set_mempolicy, MPOL_BIND, numa_nodemask, numa_maxnode)) {
+ if (errno != ENOSYS && errno != EPERM && errno != EACCES && errno != EINVAL)
+ tst_brk(TBROK | TERRNO, "set_mempolicy(MPOL_BIND) failed");
+ tst_res(TCONF | TERRNO, "Cannot bind memory to the target NUMA node");
+ return 0;
+ }
+ numa_policy_set = 1;
+
+ for (index = 0; index < NUMA_NODES; index++)
+ numa_pool_sizes[index] = read_numa_hugepages(index, "nr_hugepages");
+ numa_pools_saved = 1;
+
+ if (!numa_pool_sizes[NUMA_SOURCE] && !set_numa_hugepages(NUMA_SOURCE, 1)) {
+ tst_res(TCONF, "Cannot allocate a hugepage on source node %lu",
+ numa_nodes[NUMA_SOURCE]);
+ return 0;
+ }
+
+ if (!set_numa_hugepages(NUMA_TARGET, MAX_BASE_POOL_SIZE) ||
+ !set_numa_hugepages(NUMA_TARGET, 0)) {
+ tst_res(TCONF, "Cannot prepare the hugepage pool on target node %lu",
+ numa_nodes[NUMA_TARGET]);
+ return 0;
+ }
+
+ read_meminfo_huge(&prev_total, &prev_free, &prev_resv, &prev_surp);
+ if (prev_total != prev_free || !prev_free || prev_resv || prev_surp ||
+ !read_numa_hugepages(NUMA_SOURCE, "free_hugepages") ||
+ read_numa_hugepages(NUMA_TARGET, "free_hugepages")) {
+ tst_res(TCONF, "Cannot establish the NUMA surplus allocation preconditions");
+ return 0;
+ }
+ numa_remote_free = prev_free;
+ tst_res(TINFO, "NUMA target node %lu has an empty pool with %ld free hugepages on other nodes",
+ numa_nodes[NUMA_TARGET], numa_remote_free);
+
+ return 1;
+}
+
+static void run_test(unsigned int index)
+{
+ if (!index || prepare_numa_test())
+ run_counter_test();
+
per_iteration_cleanup();
+ restore_numa_state();
}
static void setup(void)
@@ -611,6 +801,7 @@ static void setup(void)
static void cleanup(void)
{
per_iteration_cleanup();
+ restore_numa_state();
}
static struct tst_test test = {
@@ -633,6 +824,7 @@ static struct tst_test test = {
},
.setup = setup,
.cleanup = cleanup,
- .test_all = run_test,
+ .test = run_test,
+ .tcnt = 2,
.hugepages = {3, TST_NEEDS},
};
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH v2 3/3] hugemmap10: Add NUMA counter test diagnostics
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 8:05 ` [LTP] [PATCH v2 2/3] hugemmap10: Reuse counter tests with a NUMA bind policy Huaisheng Ye
@ 2026-11-23 8:05 ` Huaisheng Ye
2 siblings, 0 replies; 6+ messages in thread
From: Huaisheng Ye @ 2026-11-23 8:05 UTC (permalink / raw)
To: li.wang, chrubis, pvorel; +Cc: ltp
Add TDEBUG output for NUMA node selection, saved memory policy,
pool changes and restoration so NUMA setup and cleanup failures can
be diagnosed.
Signed-off-by: Huaisheng Ye <yehuaisheng@open-hieco.net>
---
.../kernel/mem/hugetlb/hugemmap/hugemmap10.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
index 4c36df789..ca6eecec0 100644
--- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
+++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap10.c
@@ -369,6 +369,8 @@ static int map_(int s, int hpages, int flags, char *desc, int line)
map_size[s] = hpages * hpage_size;
if (creates_reservation)
allowed_free = read_allowed_free_hugepages();
+ tst_res_(__FILE__, line, TDEBUG, "While %s: mmap(len=%lu, flags=%#x, fd=%d)",
+ desc, map_size[s], mmap_flags, map_fd[s]);
TESTPTR(mmap(NULL, map_size[s], PROT_READ | PROT_WRITE, mmap_flags, map_fd[s], 0));
if (TST_RET_PTR == MAP_FAILED) {
tst_res_(__FILE__, line, TFAIL | TTERRNO, "While %s: mmap() failed", desc);
@@ -665,6 +667,8 @@ static void restore_numa_state(void)
numa_maxnode)) {
tst_res(TWARN | TERRNO, "Failed to restore memory policy");
failed = 1;
+ } else {
+ tst_res(TDEBUG, "Restored memory policy mode %d", saved_policy);
}
numa_policy_set = 0;
}
@@ -675,6 +679,9 @@ static void restore_numa_state(void)
tst_res(TWARN, "Failed to restore node %lu hugepage pool",
numa_nodes[index]);
failed = 1;
+ } else {
+ tst_res(TDEBUG, "Restored node %lu nr_hugepages to %lu",
+ numa_nodes[index], numa_pool_sizes[index]);
}
}
numa_pools_saved = 0;
@@ -705,6 +712,8 @@ static int prepare_numa_test(void)
}
if (separator == '-')
numa_nodes[NUMA_TARGET] = numa_nodes[NUMA_SOURCE] + 1;
+ tst_res(TDEBUG, "Selected NUMA source node %lu and target node %lu",
+ numa_nodes[NUMA_SOURCE], numa_nodes[NUMA_TARGET]);
if (numa_nodes[NUMA_TARGET] >= numa_maxnode) {
tst_res(TCONF, "NUMA node ID exceeds the nodemask capacity");
return 0;
@@ -739,6 +748,7 @@ static int prepare_numa_test(void)
tst_res(TCONF | TERRNO, "NUMA memory policies are unavailable");
return 0;
}
+ tst_res(TDEBUG, "Saved memory policy mode %d", saved_policy);
node_set(numa_nodes[NUMA_TARGET], numa_nodemask);
if (syscall(__NR_set_mempolicy, MPOL_BIND, numa_nodemask, numa_maxnode)) {
@@ -748,10 +758,15 @@ static int prepare_numa_test(void)
return 0;
}
numa_policy_set = 1;
+ tst_res(TDEBUG, "Bound memory policy to NUMA target node %lu",
+ numa_nodes[NUMA_TARGET]);
for (index = 0; index < NUMA_NODES; index++)
numa_pool_sizes[index] = read_numa_hugepages(index, "nr_hugepages");
numa_pools_saved = 1;
+ tst_res(TDEBUG, "Saved node %lu nr_hugepages=%lu, node %lu nr_hugepages=%lu",
+ numa_nodes[NUMA_SOURCE], numa_pool_sizes[NUMA_SOURCE],
+ numa_nodes[NUMA_TARGET], numa_pool_sizes[NUMA_TARGET]);
if (!numa_pool_sizes[NUMA_SOURCE] && !set_numa_hugepages(NUMA_SOURCE, 1)) {
tst_res(TCONF, "Cannot allocate a hugepage on source node %lu",
@@ -782,6 +797,8 @@ static int prepare_numa_test(void)
static void run_test(unsigned int index)
{
+ tst_res(TDEBUG, "Running hugemmap10 test case %u", index);
+
if (!index || prepare_numa_test())
run_counter_test();
@@ -793,6 +810,8 @@ static void setup(void)
{
hpage_size = SAFE_READ_MEMINFO(MEMINFO_HPAGE_SIZE)*1024;
SAFE_FILE_PRINTF(PATH_VM_OVERCOMMIT_HPAGES, "%lu", tst_hugepages);
+ tst_res(TDEBUG, "Hugepage size=%ld kB, nr_overcommit_hugepages=%lu",
+ hpage_size / 1024, tst_hugepages);
private_resv = kernel_has_private_reservations();
tst_res(TDEBUG, "MAP_PRIVATE mmap() %s a hugetlb reservation",
private_resv ? "creates" : "does not create");
--
2.52.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] hugemmap10: Add linux-git tag for NUMA fix
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 ` linuxtestproject.agent
0 siblings, 0 replies; 6+ messages in thread
From: linuxtestproject.agent @ 2026-11-23 20:43 UTC (permalink / raw)
To: Huaisheng Ye; +Cc: ltp
Hi Huaisheng,
On Mon Nov 23 16:05:35 2026 +0800, Huaisheng Ye wrote:
> hugemmap10: Add linux-git tag for NUMA fix
Verdict - Reviewed
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox