[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1458767880-3288-5-git-send-email-acme@kernel.org>
Date: Wed, 23 Mar 2016 18:17:41 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: linux-kernel@...r.kernel.org, Jakub Jelen <jakuje@...il.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jakub Jelen <jjelen@...hat.com>,
Peter Zijlstra <peterz@...radead.org>, trivial@...nel.org,
Arnaldo Carvalho de Melo <acme@...hat.com>
Subject: [PATCH 04/23] perf bench numa: Fix assertion for nodes bitfield
From: Jakub Jelen <jakuje@...il.com>
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 <jakuje@...il.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Jakub Jelen <jjelen@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: trivial@...nel.org
Link: http://lkml.kernel.org/r/1458388687-24421-1-git-send-email-jakuje@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/bench/numa.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/perf/bench/numa.c b/tools/perf/bench/numa.c
index 5049d6357a46..7500d959d7eb 100644
--- a/tools/perf/bench/numa.c
+++ b/tools/perf/bench/numa.c
@@ -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);
--
2.5.5
Powered by blists - more mailing lists