diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c index fa56fde6e8d8036921e8b012bc69ae9afb70581a..91c0a4434da2767a6eedef5d0b3d0d90d274b368 100644 --- a/tools/perf/bench/numa.c +++ b/tools/perf/bench/numa.c @@ -378,8 +378,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;