All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jakub Jelen <jakuje@gmail.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jakub Jelen <jjelen@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	trivial@kernel.org, Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 04/23] perf bench numa: Fix assertion for nodes bitfield
Date: Wed, 23 Mar 2016 18:17:41 -0300	[thread overview]
Message-ID: <1458767880-3288-5-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1458767880-3288-1-git-send-email-acme@kernel.org>

From: Jakub Jelen <jakuje@gmail.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@gmail.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jakub Jelen <jjelen@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: trivial@kernel.org
Link: http://lkml.kernel.org/r/1458388687-24421-1-git-send-email-jakuje@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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

  parent reply	other threads:[~2016-03-23 21:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23 21:17 [GIT PULL 00/23] perf/core improvements and fixes Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 01/23] perf test: Remove 'core_id' check in topo test Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 02/23] tools: Move utilities.mak from perf to tools/scripts/ Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 03/23] perf symbols: Record text offset in dso to calculate objdump address Arnaldo Carvalho de Melo
2016-03-23 21:17 ` Arnaldo Carvalho de Melo [this message]
2016-03-23 21:17 ` [PATCH 05/23] perf list: Fix documentation of :ppp Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 06/23] perf tools: Remove misplaced __maybe_unused Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 07/23] perf tests: Forward the perf_sample in the dwarf unwind test Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 08/23] perf tools: Add cpumode to struct perf_sample Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 09/23] perf machine: Rename perf_event__preprocess_sample to machine__resolve Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 10/23] perf thread: Rename perf_event__preprocess_sample_addr to thread__resolve Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 11/23] perf script: Remove lots of unused arguments Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 12/23] perf tools: Remove unused DIE_IF macro Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 13/23] perf tools: Simplify die() mechanism Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 14/23] perf tools: Remove needless 'extern' from function prototypes Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 15/23] tools lib traceevent: Remove redundant CPU output Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 16/23] tools include: Copy linux/stringify.h from the kernel Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 17/23] perf tools: Do not include stringify.h from the kernel sources Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 18/23] perf tools: Remove unused perf_pathdup, xstrdup functions Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 19/23] perf help: Use asprintf instead of adhoc equivalents Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 20/23] perf probe: No need to use formatting strbuf method Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 21/23] perf tools: Unexport some methods unused outside strbuf.c Arnaldo Carvalho de Melo
2016-03-23 21:17 ` [PATCH 22/23] perf llvm: Use realpath to canonicalize paths Arnaldo Carvalho de Melo
2016-03-23 21:18 ` [PATCH 23/23] perf llvm: Use strerror_r instead of the thread unsafe strerror one Arnaldo Carvalho de Melo
2016-03-24  7:32 ` [GIT PULL 00/23] perf/core improvements and fixes Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458767880-3288-5-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jakuje@gmail.com \
    --cc=jjelen@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.