When split NUMA node uniformly, split_nodes_size_interleave_uniform() returns the next absolute node ID, not the number of nodes created. The previous under-allocation detection logic compares next absolute node ID (ret) and request count (n), which only works when nid starts at 0. Fix under-allocation detection logic to compare the number of actually created nodes (ret - nid) against the request count (n). Signed-off-by: Sang-Heon Jeon Reported-by: Donghyeon Lee Reported-by: Munhui Chae Fixes: cc9aec03e58f ("x86/numa_emulation: Introduce uniform split capability") # 4.19 --- mm/numa_emulation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/numa_emulation.c b/mm/numa_emulation.c index 703c8fa05048..e7f856c8f2a1 100644 --- a/mm/numa_emulation.c +++ b/mm/numa_emulation.c @@ -416,7 +416,7 @@ void __init numa_emulation(struct numa_meminfo *numa_meminfo, int numa_dist_cnt) n, &pi.blk[0], nid); if (ret < 0) break; - if (ret < n) { + if (ret - nid < n) { pr_info("%s: phys: %d only got %d of %ld nodes, failing\n", __func__, i, ret, n); ret = -1; -- 2.43.0