LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>, Yinghai Lu <yinghai@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org
Subject: [patch] x86, numa: Fix CONFIG_DEBUG_PER_CPU_MAPS without NUMA emulation
Date: Thu, 30 Dec 2010 10:54:16 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.00.1012301053590.12995@chino.kir.corp.google.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1012301052050.12995@chino.kir.corp.google.com>
"x86, numa: Fake node-to-cpumask for NUMA emulation" broke the build when
CONFIG_DEBUG_PER_CPU_MAPS is set and CONFIG_NUMA_EMU is not. This is
because it is possible to map a cpu to multiple nodes when NUMA emulation
is used; the patch required a physical node address table to find those
nodes that was only available when CONFIG_NUMA_EMU was enabled.
This extracts the common debug functionality to its own function for
CONFIG_DEBUG_PER_CPU_MAPS and uses it regardless of whether
CONFIG_NUMA_EMU is set or not.
NUMA emulation will now iterate over the set of possible nodes for each
cpu and call the new debug function whereas only the cpu's node will be
used without NUMA emulation enabled.
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David Rientjes <rientjes@google.com>
---
arch/x86/mm/numa_64.c | 48 +++++++++++++++++++++++++++++++++++++-----------
1 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -833,15 +833,48 @@ void __cpuinit numa_remove_cpu(int cpu)
#endif /* !CONFIG_NUMA_EMU */
#else /* CONFIG_DEBUG_PER_CPU_MAPS */
+static struct cpumask __cpuinit *debug_cpumask_set_cpu(int cpu, int enable)
+{
+ int node = early_cpu_to_node(cpu);
+ struct cpumask *mask;
+ char buf[64];
+
+ mask = node_to_cpumask_map[node];
+ if (!mask) {
+ pr_err("node_to_cpumask_map[%i] NULL\n", node);
+ dump_stack();
+ return NULL;
+ }
+
+ cpulist_scnprintf(buf, sizeof(buf), mask);
+ printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
+ enable ? "numa_add_cpu" : "numa_remove_cpu",
+ cpu, node, buf);
+ return mask;
+}
/*
* --------- debug versions of the numa functions ---------
*/
+#ifndef CONFIG_NUMA_EMU
+static void __cpuinit numa_set_cpumask(int cpu, int enable)
+{
+ struct cpumask *mask;
+
+ mask = debug_cpumask_set_cpu(cpu, enable);
+ if (!mask)
+ return;
+
+ if (enable)
+ cpumask_set_cpu(cpu, mask);
+ else
+ cpumask_clear_cpu(cpu, mask);
+}
+#else
static void __cpuinit numa_set_cpumask(int cpu, int enable)
{
int node = early_cpu_to_node(cpu);
struct cpumask *mask;
- char buf[64];
int i;
for_each_online_node(i) {
@@ -851,24 +884,17 @@ static void __cpuinit numa_set_cpumask(int cpu, int enable)
if (addr < physnodes[node].start ||
addr >= physnodes[node].end)
continue;
- mask = node_to_cpumask_map[node];
- if (mask == NULL) {
- pr_err("node_to_cpumask_map[%i] NULL\n", i);
- dump_stack();
+ mask = debug_cpumask_set_cpu(cpu, enable);
+ if (!mask)
return;
- }
if (enable)
cpumask_set_cpu(cpu, mask);
else
cpumask_clear_cpu(cpu, mask);
-
- cpulist_scnprintf(buf, sizeof(buf), mask);
- printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
- enable ? "numa_add_cpu" : "numa_remove_cpu",
- cpu, node, buf);
}
}
+#endif /* CONFIG_NUMA_EMU */
void __cpuinit numa_add_cpu(int cpu)
{
next prev parent reply other threads:[~2010-12-30 18:54 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-18 0:58 [PATCH 0/3] memblock related top down Yinghai Lu
2010-12-28 0:47 ` [PATCH 0/6] memblock related further cleanup for x86 Yinghai Lu
[not found] ` <4D19320B.7030007@kernel.org>
2010-12-28 0:47 ` [PATCH 1/6] x86: Change get_max_mapped() to inline Yinghai Lu
2010-12-29 23:05 ` H. Peter Anvin
2010-12-29 23:30 ` Yinghai Lu
2010-12-29 23:37 ` Yinghai Lu
2010-12-29 23:42 ` H. Peter Anvin
2010-12-29 23:45 ` [PATCH -v2 " Yinghai Lu
2011-02-16 8:50 ` [tip:x86/mm] " tip-bot for Yinghai Lu
2010-12-28 0:48 ` [PATCH 2/6] x86, 64bit, numa: Allocate memnodemap under max_pfn_mapped Yinghai Lu
2011-02-16 8:50 ` [tip:x86/mm] x86-64, " tip-bot for Yinghai Lu
2010-12-28 0:48 ` [PATCH 3/6] x86, 64bit, numa: Put pgtable to local node memory Yinghai Lu
2010-12-29 23:46 ` [PATCH -v2 " Yinghai Lu
2010-12-29 23:50 ` H. Peter Anvin
2010-12-30 0:11 ` Yinghai Lu
2010-12-30 0:39 ` David Rientjes
2010-12-30 0:58 ` H. Peter Anvin
2010-12-30 1:07 ` David Rientjes
2010-12-30 1:53 ` H. Peter Anvin
2010-12-30 9:06 ` Ingo Molnar
2010-12-30 10:28 ` [boot crash] " Ingo Molnar
2010-12-30 10:30 ` Ingo Molnar
2010-12-30 12:01 ` [build failure] " Ingo Molnar
2010-12-30 18:53 ` David Rientjes
2010-12-30 18:54 ` David Rientjes [this message]
2011-01-06 20:39 ` [patch] x86, numa: Fix CONFIG_DEBUG_PER_CPU_MAPS without NUMA emulation David Rientjes
2011-01-06 21:25 ` Yinghai Lu
2011-01-06 23:58 ` David Rientjes
2011-01-07 15:32 ` [tip:x86/numa] " tip-bot for David Rientjes
2010-12-30 21:18 ` [boot crash] Re: [PATCH -v2 3/6] x86, 64bit, numa: Put pgtable to local node memory Yinghai Lu
[not found] ` <AANLkTimpyRXS9dNFATh4GqtA46uynutAvK7Qb5S7WPFO@mail.gmail.com>
[not found] ` <20110105134434.GA22816@elte.hu>
2011-01-05 21:24 ` Yinghai Lu
2011-01-07 20:41 ` [PATCH] memblock: Don't adjust size in memblock_find_base() Yinghai Lu
2011-01-10 5:56 ` Benjamin Herrenschmidt
2011-01-10 6:59 ` Yinghai Lu
2011-01-12 1:35 ` Yinghai Lu
2011-01-29 0:37 ` [PATCH - resend] " Yinghai Lu
2011-02-03 20:25 ` Andrew Morton
2011-02-03 20:37 ` Yinghai Lu
2011-02-16 8:51 ` [tip:x86/mm] x86-64, numa: Put pgtable to local node memory tip-bot for Yinghai Lu
2010-12-28 0:48 ` [PATCH 4/6] x86: Use early pre-allocated page table buffer top-down Yinghai Lu
2010-12-28 0:48 ` [PATCH 5/6] x86, 64bit: Move out cleanup higmap [_brk_end, _end) out of init_memory_mapping() Yinghai Lu
2011-02-16 8:51 ` [tip:x86/mm] x86-64: " tip-bot for Yinghai Lu
2010-12-28 0:48 ` [PATCH 6/6] x86: Rename e820_table_* to pgt_buf_* Yinghai Lu
2010-12-30 21:54 ` [PATCH -v2 " Yinghai Lu
2010-12-28 20:21 ` [PATCH 0/3] memblock related top down H. Peter Anvin
2010-12-28 21:36 ` Yinghai Lu
2010-12-28 22:09 ` H. Peter Anvin
2010-12-28 22:25 ` Yinghai Lu
[not found] <alpine.DEB.2.00.1012221700130.3701@chino.kir.corp.google.com>
2010-12-24 20:45 ` [patch 0/5] x86, numa: Fixes for NUMA emulation Ingo Molnar
2010-12-26 21:58 ` [patch] x86, numa: Fix CONFIG_DEBUG_PER_CPU_MAPS without " David Rientjes
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=alpine.DEB.2.00.1012301053590.12995@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=tglx@linutronix.de \
--cc=yinghai@kernel.org \
--subject='Re: [patch] x86, numa: Fix CONFIG_DEBUG_PER_CPU_MAPS without NUMA emulation' \
/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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).