]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/mm/numa.c
Merge commit 'v2.6.26-rc8' into x86/mce
[linux-2.6-omap-h63xx.git] / arch / powerpc / mm / numa.c
index 1666e7d54cca9faa5cd687aaa64ae5290cebd752..dc704da363eb77897d392781591bf87ac337a8dd 100644 (file)
 #include <linux/nodemask.h>
 #include <linux/cpu.h>
 #include <linux/notifier.h>
+#include <linux/lmb.h>
+#include <linux/of.h>
 #include <asm/sparsemem.h>
-#include <asm/lmb.h>
+#include <asm/prom.h>
 #include <asm/system.h>
 #include <asm/smp.h>
 
@@ -46,10 +48,20 @@ static int __cpuinit fake_numa_create_new_node(unsigned long end_pfn,
 {
        unsigned long long mem;
        char *p = cmdline;
-       static unsigned int fake_nid = 0;
-       static unsigned long long curr_boundary = 0;
+       static unsigned int fake_nid;
+       static unsigned long long curr_boundary;
 
-       *nid = fake_nid;
+       /*
+        * Modify node id, iff we started creating NUMA nodes
+        * We want to continue from where we left of the last time
+        */
+       if (fake_nid)
+               *nid = fake_nid;
+       /*
+        * In case there are no more arguments to parse, the
+        * node_id should be the same as the last fake node id
+        * (we've handled this above).
+        */
        if (!p)
                return 0;
 
@@ -384,13 +396,14 @@ static void __init parse_drconf_memory(struct device_node *memory)
                                nid = default_nid;
                }
 
+               fake_numa_create_new_node(((start + lmb_size) >> PAGE_SHIFT),
+                                               &nid);
+               node_set_online(nid);
+
                size = numa_enforce_memory_limit(start, lmb_size);
                if (!size)
                        continue;
 
-               fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid);
-               node_set_online(nid);
-
                add_active_range(nid, start >> PAGE_SHIFT,
                                 (start >> PAGE_SHIFT) + (size >> PAGE_SHIFT));
        }
@@ -471,6 +484,9 @@ new_range:
                if (nid < 0)
                        nid = default_nid;
 
+               fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid);
+               node_set_online(nid);
+
                if (!(size = numa_enforce_memory_limit(start, size))) {
                        if (--ranges)
                                goto new_range;
@@ -478,9 +494,6 @@ new_range:
                                continue;
                }
 
-               fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid);
-               node_set_online(nid);
-
                add_active_range(nid, start >> PAGE_SHIFT,
                                (start >> PAGE_SHIFT) + (size >> PAGE_SHIFT));
 
@@ -720,7 +733,7 @@ void __init do_init_bootmem(void)
                                dbg("reserve_bootmem %lx %lx\n", physbase,
                                    size);
                                reserve_bootmem_node(NODE_DATA(nid), physbase,
-                                                    size);
+                                                    size, BOOTMEM_DEFAULT);
                        }
                }