Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1361093 > unrolled thread

[PATCH] perf bench numa: Fix assertion for nodes bitfield

Started byJakub Jelen <jakuje@gmail.com>
First post2016-03-19 13:00 +0100
Last post2016-03-24 08:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] perf bench numa: Fix assertion for nodes bitfield Jakub Jelen <jakuje@gmail.com> - 2016-03-19 13:00 +0100
    Re: [PATCH] perf bench numa: Fix assertion for nodes bitfield Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-03-21 21:50 +0100
    [tip:perf/urgent] perf bench numa: Fix assertion for nodes bitfield tip-bot for Jakub Jelen <tipbot@zytor.com> - 2016-03-24 08:40 +0100

#1361093 — [PATCH] perf bench numa: Fix assertion for nodes bitfield

FromJakub Jelen <jakuje@gmail.com>
Date2016-03-19 13:00 +0100
Subject[PATCH] perf bench numa: Fix assertion for nodes bitfield
Message-ID<renHX-7LJ-1@gated-at.bofh.it>
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>
---
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.

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

[toc] | [next] | [standalone]


#1362145

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2016-03-21 21:50 +0100
Message-ID<rfeVY-2so-13@gated-at.bofh.it>
In reply to#1361093
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 <jakuje@gmail.com>
> ---
> 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

[toc] | [prev] | [next] | [standalone]


#1363968 — [tip:perf/urgent] perf bench numa: Fix assertion for nodes bitfield

Fromtip-bot for Jakub Jelen <tipbot@zytor.com>
Date2016-03-24 08:40 +0100
Subject[tip:perf/urgent] perf bench numa: Fix assertion for nodes bitfield
Message-ID<rg826-7Ko-3@gated-at.bofh.it>
In reply to#1361093
Commit-ID:  3c52b658b8e4fbbf7975932bbdc4798421dbcb15
Gitweb:     http://git.kernel.org/tip/3c52b658b8e4fbbf7975932bbdc4798421dbcb15
Author:     Jakub Jelen <jakuje@gmail.com>
AuthorDate: Sat, 19 Mar 2016 12:58:07 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 21 Mar 2016 17:46:57 -0300

perf bench numa: Fix assertion for nodes bitfield

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 5049d63..7500d95 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);

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web