diff options
author | Nicolas Pitre <nico@cam.org> | 2008-09-17 15:21:55 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@cam.org> | 2009-03-15 21:01:21 -0400 |
commit | 3835f6cb645bdb9a58aa6e062fe1d5777f1a9748 (patch) | |
tree | de3429794bb06cab351a7909da7c8c33bfa38567 /arch/arm/mm | |
parent | d73cd42893f4cdc06e6829fea2347bb92cb789d1 (diff) |
[ARM] mem_init(): make highmem pages available for use
Signed-off-by: Nicolas Pitre <nico@marvell.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/init.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 80fd3b69ae1f..8277802ec859 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/mman.h> | 15 | #include <linux/mman.h> |
16 | #include <linux/nodemask.h> | 16 | #include <linux/nodemask.h> |
17 | #include <linux/initrd.h> | 17 | #include <linux/initrd.h> |
18 | #include <linux/highmem.h> | ||
18 | 19 | ||
19 | #include <asm/mach-types.h> | 20 | #include <asm/mach-types.h> |
20 | #include <asm/sections.h> | 21 | #include <asm/sections.h> |
@@ -485,7 +486,7 @@ void __init mem_init(void) | |||
485 | int i, node; | 486 | int i, node; |
486 | 487 | ||
487 | #ifndef CONFIG_DISCONTIGMEM | 488 | #ifndef CONFIG_DISCONTIGMEM |
488 | max_mapnr = virt_to_page(high_memory) - mem_map; | 489 | max_mapnr = pfn_to_page(max_pfn + PHYS_PFN_OFFSET) - mem_map; |
489 | #endif | 490 | #endif |
490 | 491 | ||
491 | /* this will put all unused low memory onto the freelists */ | 492 | /* this will put all unused low memory onto the freelists */ |
@@ -504,6 +505,19 @@ void __init mem_init(void) | |||
504 | __phys_to_pfn(__pa(swapper_pg_dir)), NULL); | 505 | __phys_to_pfn(__pa(swapper_pg_dir)), NULL); |
505 | #endif | 506 | #endif |
506 | 507 | ||
508 | #ifdef CONFIG_HIGHMEM | ||
509 | /* set highmem page free */ | ||
510 | for_each_online_node(node) { | ||
511 | for_each_nodebank (i, &meminfo, node) { | ||
512 | unsigned long start = bank_pfn_start(&meminfo.bank[i]); | ||
513 | unsigned long end = bank_pfn_end(&meminfo.bank[i]); | ||
514 | if (start >= max_low_pfn + PHYS_PFN_OFFSET) | ||
515 | totalhigh_pages += free_area(start, end, NULL); | ||
516 | } | ||
517 | } | ||
518 | totalram_pages += totalhigh_pages; | ||
519 | #endif | ||
520 | |||
507 | /* | 521 | /* |
508 | * Since our memory may not be contiguous, calculate the | 522 | * Since our memory may not be contiguous, calculate the |
509 | * real number of pages we have in this system | 523 | * real number of pages we have in this system |
@@ -521,9 +535,10 @@ void __init mem_init(void) | |||
521 | initsize = __init_end - __init_begin; | 535 | initsize = __init_end - __init_begin; |
522 | 536 | ||
523 | printk(KERN_NOTICE "Memory: %luKB available (%dK code, " | 537 | printk(KERN_NOTICE "Memory: %luKB available (%dK code, " |
524 | "%dK data, %dK init)\n", | 538 | "%dK data, %dK init, %luK highmem)\n", |
525 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), | 539 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), |
526 | codesize >> 10, datasize >> 10, initsize >> 10); | 540 | codesize >> 10, datasize >> 10, initsize >> 10, |
541 | (unsigned long) (totalhigh_pages << (PAGE_SHIFT-10))); | ||
527 | 542 | ||
528 | if (PAGE_SIZE >= 16384 && num_physpages <= 128) { | 543 | if (PAGE_SIZE >= 16384 && num_physpages <= 128) { |
529 | extern int sysctl_overcommit_memory; | 544 | extern int sysctl_overcommit_memory; |