aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-05-02 08:18:53 -0400
committerTejun Heo <tj@kernel.org>2011-05-02 08:18:53 -0400
commitb0d310801a4c1f95b44357e4ebc22a9903e3bf3d (patch)
tree4a61939f1254967b88cfee59e6c3b450f70368c7 /arch
parente6df595b37c7c033ef7400b4fdd382a2dc4f4131 (diff)
x86-32, NUMA: implement temporary NUMA init shims
To help transition to common NUMA init, implement temporary 32bit shims for numa_add_memblk() and numa_set_distance(). numa_add_memblk() registers the memblk and adjusts node_start/end_pfn[]. numa_set_distance() is noop. These shims will allow using 64bit NUMA init functions on 32bit and gradual transition to common NUMA init path. For detailed description, please read description of commits which make use of the shim functions. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/numa.h3
-rw-r--r--arch/x86/include/asm/numa_64.h3
-rw-r--r--arch/x86/mm/numa_32.c34
3 files changed, 37 insertions, 3 deletions
diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h
index c24306cd1504..db449c7d89b3 100644
--- a/arch/x86/include/asm/numa.h
+++ b/arch/x86/include/asm/numa.h
@@ -21,6 +21,9 @@
21extern s16 __apicid_to_node[MAX_LOCAL_APIC]; 21extern s16 __apicid_to_node[MAX_LOCAL_APIC];
22extern nodemask_t numa_nodes_parsed __initdata; 22extern nodemask_t numa_nodes_parsed __initdata;
23 23
24extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
25extern void __init numa_set_distance(int from, int to, int distance);
26
24static inline void set_apicid_to_node(int apicid, s16 node) 27static inline void set_apicid_to_node(int apicid, s16 node)
25{ 28{
26 __apicid_to_node[apicid] = node; 29 __apicid_to_node[apicid] = node;
diff --git a/arch/x86/include/asm/numa_64.h b/arch/x86/include/asm/numa_64.h
index e84113f8fff3..506dd050ff30 100644
--- a/arch/x86/include/asm/numa_64.h
+++ b/arch/x86/include/asm/numa_64.h
@@ -15,9 +15,6 @@ extern unsigned long numa_free_all_bootmem(void);
15 */ 15 */
16#define NODE_MIN_SIZE (4*1024*1024) 16#define NODE_MIN_SIZE (4*1024*1024)
17 17
18extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
19extern void __init numa_set_distance(int from, int to, int distance);
20
21#ifdef CONFIG_NUMA_EMU 18#ifdef CONFIG_NUMA_EMU
22#define FAKE_NODE_MIN_SIZE ((u64)32 << 20) 19#define FAKE_NODE_MIN_SIZE ((u64)32 << 20)
23#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL)) 20#define FAKE_NODE_MIN_HASH_MASK (~(FAKE_NODE_MIN_SIZE - 1UL))
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index abf1247a4c32..d0369a56f843 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -414,3 +414,37 @@ int memory_add_physaddr_to_nid(u64 addr)
414EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); 414EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
415#endif 415#endif
416 416
417/* temporary shim, will go away soon */
418int __init numa_add_memblk(int nid, u64 start, u64 end)
419{
420 unsigned long start_pfn = start >> PAGE_SHIFT;
421 unsigned long end_pfn = end >> PAGE_SHIFT;
422
423 printk(KERN_DEBUG "nid %d start_pfn %08lx end_pfn %08lx\n",
424 nid, start_pfn, end_pfn);
425
426 if (start >= (u64)max_pfn << PAGE_SHIFT) {
427 printk(KERN_INFO "Ignoring SRAT pfns: %08lx - %08lx\n",
428 start_pfn, end_pfn);
429 return 0;
430 }
431
432 node_set_online(nid);
433 memblock_x86_register_active_regions(nid, start_pfn,
434 min(end_pfn, max_pfn));
435
436 if (!node_has_online_mem(nid)) {
437 node_start_pfn[nid] = start_pfn;
438 node_end_pfn[nid] = end_pfn;
439 } else {
440 node_start_pfn[nid] = min(node_start_pfn[nid], start_pfn);
441 node_end_pfn[nid] = max(node_end_pfn[nid], end_pfn);
442 }
443 return 0;
444}
445
446/* temporary shim, will go away soon */
447void __init numa_set_distance(int from, int to, int distance)
448{
449 /* nada */
450}