From: Chen Gong <gong.chen@linux.intel.com>
To: haicheng.li@linux.intel.com, hpa@zytor.com, andi-nbz@firstfloor.org
Cc: linux-numa@vger.kernel.org, Chen Gong <gong.chen@linux.intel.com>
Subject: [PATCH] x86: more strict check when cpu hot-plugged
Date: Wed, 24 Mar 2010 13:37:54 +0800 [thread overview]
Message-ID: <1269409074-30091-2-git-send-email-gong.chen@linux.intel.com> (raw)
In-Reply-To: <1269409074-30091-1-git-send-email-gong.chen@linux.intel.com>
When cpu is hot-plugged, it needs to be registered to one
proper node under NUMA enabled mode. The check condition
is very important so the more strict check is necessary.
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
---
arch/x86/include/asm/numa_64.h | 1 +
arch/x86/kernel/acpi/boot.c | 8 +++++++-
arch/x86/mm/numa_64.c | 2 +-
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/numa_64.h b/arch/x86/include/asm/numa_64.h
index 823e070..c1ffb7f 100644
--- a/arch/x86/include/asm/numa_64.h
+++ b/arch/x86/include/asm/numa_64.h
@@ -31,6 +31,7 @@ extern void setup_node_bootmem(int nodeid, unsigned long start,
*/
#define NODE_MIN_SIZE (4*1024*1024)
+extern int __cpuinit find_near_online_node(int node);
extern void __init init_cpu_to_node(void);
extern void __cpuinit numa_set_node(int cpu, int node);
extern void __cpuinit numa_clear_node(int cpu);
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 0061ea2..6f911aa 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -498,12 +498,18 @@ static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
int nid;
nid = acpi_get_node(handle);
- if (nid == -1 || !node_online(nid))
+ if (nid == NUMA_NO_NODE || physid == BAD_APICID)
return;
#ifdef CONFIG_X86_64
+ if (!node_online(nid))
+ nid = find_near_online_node(nid);
+
apicid_to_node[physid] = nid;
numa_set_node(cpu, nid);
#else /* CONFIG_X86_32 */
+ if (!node_online(nid))
+ return;
+
apicid_2_node[physid] = nid;
cpu_to_node_map[cpu] = nid;
#endif
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index 8948f47..898027b 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -733,7 +733,7 @@ early_param("numa", numa_setup);
#ifdef CONFIG_NUMA
-static __init int find_near_online_node(int node)
+int __cpuinit find_near_online_node(int node)
{
int n, val;
int min_val = INT_MAX;
--
1.7.0.2.279.gf1ba1c
parent reply other threads:[~2010-03-24 5:37 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1269409074-30091-1-git-send-email-gong.chen@linux.intel.com>]
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=1269409074-30091-2-git-send-email-gong.chen@linux.intel.com \
--to=gong.chen@linux.intel.com \
--cc=andi-nbz@firstfloor.org \
--cc=haicheng.li@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-numa@vger.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;
as well as URLs for NNTP newsgroup(s).