mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: David Rientjes <rientjes@google.com>
Cc: kosaki.motohiro@jp.fujitsu.com,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	Andreas Herrmann <herrmann.der.user@googlemail.com>,
	linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	x86@kernel.org
Subject: Re: [patch 2/2] x86, numa: Fix cpu nodemasks for NUMA emulation and CONFIG_DEBUG_PER_CPU_MAPS
Date: Thu, 21 Apr 2011 14:45:43 +0900 (JST)	[thread overview]
Message-ID: <20110421144621.7339.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1104201918470.12634@chino.kir.corp.google.com>

> cpu nodemasks under CONFIG_DEBUG_PER_CPU_MAPS when NUMA emulation is 
> enabled is currently broken because it does not iterate through every 
> emulated node and bind cpus that have affinity to it.  NUMA emulation 
> should bind each cpu to every local node to accurately represent the true 
> NUMA topology of the underlying machine.
> 
> debug_cpumask_set_cpu() needs to be fixed at the same time so that the 
> debugging information that it emits shows the new cpumask of the node 
> being assigned when the cpu is being added or removed.  It can now take 
> responsibility of setting or clearing the cpu itself to remove the need 
> for duplicate code.
> 
> Also changes its last formal, "enable", to have the correct bool type 
> since it can only be true or false.
> 
> Signed-off-by: David Rientjes <rientjes@google.com>

Ok, this is better. I haven't realized node_to_cpumask_map[] don't
need exclusive cpu map. 

Thank you!


Tested-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>



However

> -struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable)
> +void debug_cpumask_set_cpu(int cpu, int node, bool enable)
>  {
> -	int node = early_cpu_to_node(cpu);
>  	struct cpumask *mask;
>  	char buf[64];
>  
> @@ -227,9 +226,14 @@ struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable)
>  	if (!mask) {
>  		pr_err("node_to_cpumask_map[%i] NULL\n", node);
>  		dump_stack();
> -		return NULL;
> +		return;
>  	}
>  
> +	if (enable)
> +		cpumask_set_cpu(cpu, mask);
> +	else
> +		cpumask_clear_cpu(cpu, mask);
> +

Following patch also shold be apply?


From aaca24826696f7911bd66380baa18cfbe4f4b18e Mon Sep 17 00:00:00 2001
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Date: Thu, 21 Apr 2011 14:01:42 +0900
Subject: [PATCH] Fix

debug_cpumask_set_cpu() has tree return statement. we have change
rest two return statement.

Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
 arch/x86/mm/numa.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 0471b1d6..745258d 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -220,7 +220,7 @@ void debug_cpumask_set_cpu(int cpu, int node, bool enable)
 
 	if (node == NUMA_NO_NODE) {
 		/* early_cpu_to_node() already emits a warning and trace */
-		return NULL;
+		return;
 	}
 	mask = node_to_cpumask_map[node];
 	if (!mask) {
@@ -238,7 +238,7 @@ void debug_cpumask_set_cpu(int cpu, int node, bool enable)
 	printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
 		enable ? "numa_add_cpu" : "numa_remove_cpu",
 		cpu, node, buf);
-	return mask;
+	return;
 }
 
 # ifndef CONFIG_NUMA_EMU
-- 
1.7.3.1





  reply	other threads:[~2011-04-21  5:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19  4:57 Linux 2.6.39-rc4 Linus Torvalds
2011-04-19 20:04 ` [PATCH] uml: fix hppfs build Randy Dunlap
2011-04-19 20:09   ` Richard Weinberger
2011-04-20 15:39 ` Linux 2.6.39-rc4 (regression: NUMA on multi-node CPUs broken) Andreas Herrmann
2011-04-21  0:45   ` David Rientjes
2011-04-21  2:04     ` KOSAKI Motohiro
2011-04-21  2:17       ` David Rientjes
2011-04-21  5:45         ` KOSAKI Motohiro
2011-04-21  2:19     ` [patch 1/2] x86, numa: Revert "Fix fakenuma boot failure" David Rientjes
2011-04-21  2:19       ` [patch 2/2] x86, numa: Fix cpu nodemasks for NUMA emulation and CONFIG_DEBUG_PER_CPU_MAPS David Rientjes
2011-04-21  5:45         ` KOSAKI Motohiro [this message]
2011-04-21 19:43           ` David Rientjes
2011-04-21 12:10         ` [tip:x86/urgent] " tip-bot for David Rientjes
2011-04-21  5:45       ` [patch 1/2] x86, numa: Revert "Fix fakenuma boot failure" KOSAKI Motohiro
2011-04-21 12:09       ` [tip:x86/urgent] Revert "x86, NUMA: Fix " tip-bot for David Rientjes
2011-04-21 19:45     ` Linux 2.6.39-rc4 (regression: NUMA on multi-node CPUs broken) David Rientjes
2011-04-21  2:04   ` KOSAKI Motohiro
2011-04-21  6:04     ` Andreas Herrmann

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=20110421144621.7339.A69D9226@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=herrmann.der.user@googlemail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rientjes@google.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®