From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757774AbcCUUtO (ORCPT ); Mon, 21 Mar 2016 16:49:14 -0400 Received: from mail.kernel.org ([198.145.29.136]:37304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754522AbcCUUtM (ORCPT ); Mon, 21 Mar 2016 16:49:12 -0400 Date: Mon, 21 Mar 2016 17:49:07 -0300 From: Arnaldo Carvalho de Melo To: Jakub Jelen Cc: linux-kernel@vger.kernel.org, Alexander Shishkin , Ingo Molnar , Peter Zijlstra , trivial@kernel.org, Jakub Jelen Subject: Re: [PATCH] perf bench numa: Fix assertion for nodes bitfield Message-ID: <20160321204907.GA25862@kernel.org> References: <1458388687-24421-1-git-send-email-jakuje@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458388687-24421-1-git-send-email-jakuje@gmail.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Sat, Mar 19, 2016 at 12:58:07PM +0100, Jakub Jelen escreveu: > 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 > --- > Hello kernel list. > This is my first patch for kernel, so if I missed some of the guidelines, > please be patient :) I hope everything is explained in the commit message. Very good start then, I saw no problems, you looked at existing changesets (I guess), even capitalizing the first word after "perf bench numa: "! 8-) Looks fine, applied, thanks. - Arnaldo > Thanks, > Jakub > > 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 870b7e6..5276b24 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.0