aboutsummaryrefslogtreecommitdiffstats
path: root/arch/tile/kernel/setup.c
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-07-03 18:04:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:07:37 -0400
commit3f29c33194d3b5fffdccc89665982a36b408b6f9 (patch)
tree45106e3717e26af98c59cc17763067c3aa933276 /arch/tile/kernel/setup.c
parentdceccbe9209bded817f39c01a8a8bd1e69d6277a (diff)
mm/tile: prepare for removing num_physpages and simplify mem_init()
Prepare for removing num_physpages and simplify mem_init(). Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Acked-by: Chris Metcalf <cmetcalf@tilera.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Wen Congyang <wency@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/tile/kernel/setup.c')
-rw-r--r--arch/tile/kernel/setup.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index 41818e3ce97e..68b542677f6a 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -329,6 +329,7 @@ static void __init setup_memory(void)
329#if defined(CONFIG_HIGHMEM) || defined(__tilegx__) 329#if defined(CONFIG_HIGHMEM) || defined(__tilegx__)
330 long lowmem_pages; 330 long lowmem_pages;
331#endif 331#endif
332 unsigned long physpages = 0;
332 333
333 /* We are using a char to hold the cpu_2_node[] mapping */ 334 /* We are using a char to hold the cpu_2_node[] mapping */
334 BUILD_BUG_ON(MAX_NUMNODES > 127); 335 BUILD_BUG_ON(MAX_NUMNODES > 127);
@@ -388,8 +389,8 @@ static void __init setup_memory(void)
388 continue; 389 continue;
389 } 390 }
390 } 391 }
391 if (num_physpages + PFN_DOWN(range.size) > maxmem_pfn) { 392 if (physpages + PFN_DOWN(range.size) > maxmem_pfn) {
392 int max_size = maxmem_pfn - num_physpages; 393 int max_size = maxmem_pfn - physpages;
393 if (max_size > 0) { 394 if (max_size > 0) {
394 pr_err("Maxmem reduced node %d to %d pages\n", 395 pr_err("Maxmem reduced node %d to %d pages\n",
395 i, max_size); 396 i, max_size);
@@ -446,7 +447,7 @@ static void __init setup_memory(void)
446 node_start_pfn[i] = start; 447 node_start_pfn[i] = start;
447 node_end_pfn[i] = end; 448 node_end_pfn[i] = end;
448 node_controller[i] = range.controller; 449 node_controller[i] = range.controller;
449 num_physpages += size; 450 physpages += size;
450 max_pfn = end; 451 max_pfn = end;
451 452
452 /* Mark node as online */ 453 /* Mark node as online */
@@ -465,7 +466,7 @@ static void __init setup_memory(void)
465 * we're willing to use at 8 million pages (32GB of 4KB pages). 466 * we're willing to use at 8 million pages (32GB of 4KB pages).
466 */ 467 */
467 cap = 8 * 1024 * 1024; /* 8 million pages */ 468 cap = 8 * 1024 * 1024; /* 8 million pages */
468 if (num_physpages > cap) { 469 if (physpages > cap) {
469 int num_nodes = num_online_nodes(); 470 int num_nodes = num_online_nodes();
470 int cap_each = cap / num_nodes; 471 int cap_each = cap / num_nodes;
471 unsigned long dropped_pages = 0; 472 unsigned long dropped_pages = 0;
@@ -476,10 +477,10 @@ static void __init setup_memory(void)
476 node_end_pfn[i] = node_start_pfn[i] + cap_each; 477 node_end_pfn[i] = node_start_pfn[i] + cap_each;
477 } 478 }
478 } 479 }
479 num_physpages -= dropped_pages; 480 physpages -= dropped_pages;
480 pr_warning("Only using %ldMB memory;" 481 pr_warning("Only using %ldMB memory;"
481 " ignoring %ldMB.\n", 482 " ignoring %ldMB.\n",
482 num_physpages >> (20 - PAGE_SHIFT), 483 physpages >> (20 - PAGE_SHIFT),
483 dropped_pages >> (20 - PAGE_SHIFT)); 484 dropped_pages >> (20 - PAGE_SHIFT));
484 pr_warning("Consider using a larger page size.\n"); 485 pr_warning("Consider using a larger page size.\n");
485 } 486 }
@@ -497,7 +498,7 @@ static void __init setup_memory(void)
497 498
498 lowmem_pages = (mappable_physpages > MAXMEM_PFN) ? 499 lowmem_pages = (mappable_physpages > MAXMEM_PFN) ?
499 MAXMEM_PFN : mappable_physpages; 500 MAXMEM_PFN : mappable_physpages;
500 highmem_pages = (long) (num_physpages - lowmem_pages); 501 highmem_pages = (long) (physpages - lowmem_pages);
501 502
502 pr_notice("%ldMB HIGHMEM available.\n", 503 pr_notice("%ldMB HIGHMEM available.\n",
503 pages_to_mb(highmem_pages > 0 ? highmem_pages : 0)); 504 pages_to_mb(highmem_pages > 0 ? highmem_pages : 0));
@@ -514,7 +515,6 @@ static void __init setup_memory(void)
514 pr_warning("Use a HIGHMEM enabled kernel.\n"); 515 pr_warning("Use a HIGHMEM enabled kernel.\n");
515 max_low_pfn = MAXMEM_PFN; 516 max_low_pfn = MAXMEM_PFN;
516 max_pfn = MAXMEM_PFN; 517 max_pfn = MAXMEM_PFN;
517 num_physpages = MAXMEM_PFN;
518 node_end_pfn[0] = MAXMEM_PFN; 518 node_end_pfn[0] = MAXMEM_PFN;
519 } else { 519 } else {
520 pr_notice("%ldMB memory available.\n", 520 pr_notice("%ldMB memory available.\n",