x86-32, NUMA: implement temporary NUMA init shims
authorTejun Heo <tj@kernel.org>
Mon, 2 May 2011 12:18:53 +0000 (14:18 +0200)
committerTejun Heo <tj@kernel.org>
Mon, 2 May 2011 12:18:53 +0000 (14:18 +0200)
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>
arch/x86/include/asm/numa.h
arch/x86/include/asm/numa_64.h
arch/x86/mm/numa_32.c

index c24306cd1504d2efa265ca283964eccbb106f5c9..db449c7d89b3d7de7766eadaccaee53f1533ca91 100644 (file)
@@ -21,6 +21,9 @@
 extern s16 __apicid_to_node[MAX_LOCAL_APIC];
 extern nodemask_t numa_nodes_parsed __initdata;
 
+extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
+extern void __init numa_set_distance(int from, int to, int distance);
+
 static inline void set_apicid_to_node(int apicid, s16 node)
 {
        __apicid_to_node[apicid] = node;
index e84113f8fff3083bf3eed16556b1a4eb8846cd3c..506dd050ff3043f016c4d536f2e34474fd9aba56 100644 (file)
@@ -15,9 +15,6 @@ extern unsigned long numa_free_all_bootmem(void);
  */
 #define NODE_MIN_SIZE (4*1024*1024)
 
-extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
-extern void __init numa_set_distance(int from, int to, int distance);
-
 #ifdef CONFIG_NUMA_EMU
 #define FAKE_NODE_MIN_SIZE     ((u64)32 << 20)
 #define FAKE_NODE_MIN_HASH_MASK        (~(FAKE_NODE_MIN_SIZE - 1UL))
index abf1247a4c32078d1ffb5948f08946db6ec2356d..d0369a56f843f6a74abb5b695d63fffa10745197 100644 (file)
@@ -414,3 +414,37 @@ int memory_add_physaddr_to_nid(u64 addr)
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
 
+/* temporary shim, will go away soon */
+int __init numa_add_memblk(int nid, u64 start, u64 end)
+{
+       unsigned long start_pfn = start >> PAGE_SHIFT;
+       unsigned long end_pfn = end >> PAGE_SHIFT;
+
+       printk(KERN_DEBUG "nid %d start_pfn %08lx end_pfn %08lx\n",
+              nid, start_pfn, end_pfn);
+
+       if (start >= (u64)max_pfn << PAGE_SHIFT) {
+               printk(KERN_INFO "Ignoring SRAT pfns: %08lx - %08lx\n",
+                      start_pfn, end_pfn);
+               return 0;
+       }
+
+       node_set_online(nid);
+       memblock_x86_register_active_regions(nid, start_pfn,
+                                            min(end_pfn, max_pfn));
+
+       if (!node_has_online_mem(nid)) {
+               node_start_pfn[nid] = start_pfn;
+               node_end_pfn[nid] = end_pfn;
+       } else {
+               node_start_pfn[nid] = min(node_start_pfn[nid], start_pfn);
+               node_end_pfn[nid] = max(node_end_pfn[nid], end_pfn);
+       }
+       return 0;
+}
+
+/* temporary shim, will go away soon */
+void __init numa_set_distance(int from, int to, int distance)
+{
+       /* nada */
+}
This page took 0.028744 seconds and 5 git commands to generate.