aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-01-26 00:40:33 -0500
committerPaul Mackerras <paulus@samba.org>2008-01-26 00:40:33 -0500
commit55852bed57a97b08ab56028f1054d48d45de3aec (patch)
treeea10be3eee9b7dd8b85a7c5f04fdb022fa097605
parent75e06e2d7dd48ba655789e143e81c73617737890 (diff)
Revert "[POWERPC] Fake NUMA emulation for PowerPC"
This reverts commit 5c3f5892a2db6757a72ce8b27cba90db06683e1d, basically because it changes behaviour even when no fake NUMA information is specified on the kernel command line. Firstly, it changes the nid, thus destroying the real NUMA information. Secondly, it also changes behaviour in that if a node ends up with no memory in it because of the memory limit, we used to set it online and now we don't. Also, in the non-NUMA case with no fake NUMA information, we do node_set_online once for each LMB now, whereas previously we only did it once. I don't know if that is actually a problem, but it does seem unnecessary. Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--arch/powerpc/mm/numa.c59
1 files changed, 5 insertions, 54 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 1666e7d54cca..c12adc3ddffd 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -24,8 +24,6 @@
24 24
25static int numa_enabled = 1; 25static int numa_enabled = 1;
26 26
27static char *cmdline __initdata;
28
29static int numa_debug; 27static int numa_debug;
30#define dbg(args...) if (numa_debug) { printk(KERN_INFO args); } 28#define dbg(args...) if (numa_debug) { printk(KERN_INFO args); }
31 29
@@ -41,43 +39,6 @@ static bootmem_data_t __initdata plat_node_bdata[MAX_NUMNODES];
41static int min_common_depth; 39static int min_common_depth;
42static int n_mem_addr_cells, n_mem_size_cells; 40static int n_mem_addr_cells, n_mem_size_cells;
43 41
44static int __cpuinit fake_numa_create_new_node(unsigned long end_pfn,
45 unsigned int *nid)
46{
47 unsigned long long mem;
48 char *p = cmdline;
49 static unsigned int fake_nid = 0;
50 static unsigned long long curr_boundary = 0;
51
52 *nid = fake_nid;
53 if (!p)
54 return 0;
55
56 mem = memparse(p, &p);
57 if (!mem)
58 return 0;
59
60 if (mem < curr_boundary)
61 return 0;
62
63 curr_boundary = mem;
64
65 if ((end_pfn << PAGE_SHIFT) > mem) {
66 /*
67 * Skip commas and spaces
68 */
69 while (*p == ',' || *p == ' ' || *p == '\t')
70 p++;
71
72 cmdline = p;
73 fake_nid++;
74 *nid = fake_nid;
75 dbg("created new fake_node with id %d\n", fake_nid);
76 return 1;
77 }
78 return 0;
79}
80
81static void __cpuinit map_cpu_to_node(int cpu, int node) 42static void __cpuinit map_cpu_to_node(int cpu, int node)
82{ 43{
83 numa_cpu_lookup_table[cpu] = node; 44 numa_cpu_lookup_table[cpu] = node;
@@ -383,14 +344,12 @@ static void __init parse_drconf_memory(struct device_node *memory)
383 if (nid == 0xffff || nid >= MAX_NUMNODES) 344 if (nid == 0xffff || nid >= MAX_NUMNODES)
384 nid = default_nid; 345 nid = default_nid;
385 } 346 }
347 node_set_online(nid);
386 348
387 size = numa_enforce_memory_limit(start, lmb_size); 349 size = numa_enforce_memory_limit(start, lmb_size);
388 if (!size) 350 if (!size)
389 continue; 351 continue;
390 352
391 fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid);
392 node_set_online(nid);
393
394 add_active_range(nid, start >> PAGE_SHIFT, 353 add_active_range(nid, start >> PAGE_SHIFT,
395 (start >> PAGE_SHIFT) + (size >> PAGE_SHIFT)); 354 (start >> PAGE_SHIFT) + (size >> PAGE_SHIFT));
396 } 355 }
@@ -470,6 +429,7 @@ new_range:
470 nid = of_node_to_nid_single(memory); 429 nid = of_node_to_nid_single(memory);
471 if (nid < 0) 430 if (nid < 0)
472 nid = default_nid; 431 nid = default_nid;
432 node_set_online(nid);
473 433
474 if (!(size = numa_enforce_memory_limit(start, size))) { 434 if (!(size = numa_enforce_memory_limit(start, size))) {
475 if (--ranges) 435 if (--ranges)
@@ -478,9 +438,6 @@ new_range:
478 continue; 438 continue;
479 } 439 }
480 440
481 fake_numa_create_new_node(((start + size) >> PAGE_SHIFT), &nid);
482 node_set_online(nid);
483
484 add_active_range(nid, start >> PAGE_SHIFT, 441 add_active_range(nid, start >> PAGE_SHIFT,
485 (start >> PAGE_SHIFT) + (size >> PAGE_SHIFT)); 442 (start >> PAGE_SHIFT) + (size >> PAGE_SHIFT));
486 443
@@ -504,7 +461,7 @@ static void __init setup_nonnuma(void)
504 unsigned long top_of_ram = lmb_end_of_DRAM(); 461 unsigned long top_of_ram = lmb_end_of_DRAM();
505 unsigned long total_ram = lmb_phys_mem_size(); 462 unsigned long total_ram = lmb_phys_mem_size();
506 unsigned long start_pfn, end_pfn; 463 unsigned long start_pfn, end_pfn;
507 unsigned int i, nid = 0; 464 unsigned int i;
508 465
509 printk(KERN_DEBUG "Top of RAM: 0x%lx, Total RAM: 0x%lx\n", 466 printk(KERN_DEBUG "Top of RAM: 0x%lx, Total RAM: 0x%lx\n",
510 top_of_ram, total_ram); 467 top_of_ram, total_ram);
@@ -514,11 +471,9 @@ static void __init setup_nonnuma(void)
514 for (i = 0; i < lmb.memory.cnt; ++i) { 471 for (i = 0; i < lmb.memory.cnt; ++i) {
515 start_pfn = lmb.memory.region[i].base >> PAGE_SHIFT; 472 start_pfn = lmb.memory.region[i].base >> PAGE_SHIFT;
516 end_pfn = start_pfn + lmb_size_pages(&lmb.memory, i); 473 end_pfn = start_pfn + lmb_size_pages(&lmb.memory, i);
517 474 add_active_range(0, start_pfn, end_pfn);
518 fake_numa_create_new_node(end_pfn, &nid);
519 add_active_range(nid, start_pfn, end_pfn);
520 node_set_online(nid);
521 } 475 }
476 node_set_online(0);
522} 477}
523 478
524void __init dump_numa_cpu_topology(void) 479void __init dump_numa_cpu_topology(void)
@@ -747,10 +702,6 @@ static int __init early_numa(char *p)
747 if (strstr(p, "debug")) 702 if (strstr(p, "debug"))
748 numa_debug = 1; 703 numa_debug = 1;
749 704
750 p = strstr(p, "fake=");
751 if (p)
752 cmdline = p + strlen("fake=");
753
754 return 0; 705 return 0;
755} 706}
756early_param("numa", early_numa); 707early_param("numa", early_numa);