Skip to content

Commit

Permalink
perf bench numa: Fix assertion for nodes bitfield
Browse files Browse the repository at this point in the history
Comparing bits and bytes in numa benchmark assertion

I hit the issue on two socket Power8 machine presenting its numa nodes
as 0,1,16,17 (according to numactl). Therefore I got error (and hang of
parent process):

    perf: bench/numa.c:296: bind_to_memnode: Assertion `!(g->p.nr_nodes > (int)sizeof(nodemask))' failed.

This is obviously false positive. We can fit all the 18 nodes into
bitfield of 8 bytes (long on 64b architecture).

Signed-off-by: Jakub Jelen <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Jakub Jelen <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
Jakuje authored and acmel committed Mar 21, 2016
1 parent 73cdf0c commit 3c52b65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/perf/bench/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static void bind_to_memnode(int node)
if (node == -1)
return;

BUG_ON(g->p.nr_nodes > (int)sizeof(nodemask));
BUG_ON(g->p.nr_nodes > (int)sizeof(nodemask)*8);
nodemask = 1L << node;

ret = set_mempolicy(MPOL_BIND, &nodemask, sizeof(nodemask)*8);
Expand Down

0 comments on commit 3c52b65

Please sign in to comment.