From 71cf3cf5d397ced49bf4eb0536906e3fcbc2eab5 Mon Sep 17 00:00:00 2001 From: Philip Yang Date: Mon, 16 Sep 2019 16:22:55 -0400 Subject: [PATCH] libhsakmt: correct number of NUMA nodes calculation numa_max_node() return the highest node number available on the current system, number of NUMA nodes should be numa_max_node() + 1. Change-Id: I20a6c17af071e73e853cb5ea6d0304c8aca52681 Signed-off-by: Philip Yang --- src/fmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmm.c b/src/fmm.c index a3f6e7b6a2..e98bf01c36 100644 --- a/src/fmm.c +++ b/src/fmm.c @@ -1468,7 +1468,7 @@ static int bind_mem_to_numa(uint32_t node_id, void *mem, if (numa_available() == -1) return 0; - num_node = numa_max_node(); + num_node = numa_max_node() + 1; /* Ignore binding requests to invalid nodes IDs */ if (node_id >= (unsigned)num_node) {