diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index df41deed0320..3bfba81d1911 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -370,8 +370,10 @@ static u8 *alloc_data(ssize_t bytes0, int map_flags, /* Allocate and initialize all memory on CPU#0: */ if (init_cpu0) { - orig_mask = bind_to_node(0); - bind_to_memnode(0); + int node = numa_node_of_cpu(0); + + orig_mask = bind_to_node(node); + bind_to_memnode(node); } bytes = bytes0 + HPSIZE;