diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 22:12:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-11 22:12:10 -0500 |
commit | d0b9706c20ebb4ba181dc26e52ac9a6861abf425 (patch) | |
tree | 436e89246fd5ebcf737cae27e135a1995155329b /arch/x86/mm/init_32.c | |
parent | 02d929502ce7b57f4835d8bb7c828d36e6d9e8ce (diff) | |
parent | 54eed6cb16ec315565aaaf8e34252ca253a68b7b (diff) |
Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/numa: Add constraints check for nid parameters
mm, x86: Remove debug_pagealloc_enabled
x86/mm: Initialize high mem before free_all_bootmem()
arch/x86/kernel/e820.c: quiet sparse noise about plain integer as NULL pointer
arch/x86/kernel/e820.c: Eliminate bubble sort from sanitize_e820_map()
x86: Fix mmap random address range
x86, mm: Unify zone_sizes_init()
x86, mm: Prepare zone_sizes_init() for unification
x86, mm: Use max_low_pfn for ZONE_NORMAL on 64-bit
x86, mm: Wrap ZONE_DMA32 with CONFIG_ZONE_DMA32
x86, mm: Use max_pfn instead of highend_pfn
x86, mm: Move zone init from paging_init() on 64-bit
x86, mm: Use MAX_DMA_PFN for ZONE_DMA on 32-bit
Diffstat (limited to 'arch/x86/mm/init_32.c')
-rw-r--r-- | arch/x86/mm/init_32.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c index 0c1da394a634..8663f6c47ccb 100644 --- a/arch/x86/mm/init_32.c +++ b/arch/x86/mm/init_32.c | |||
@@ -668,22 +668,6 @@ void __init initmem_init(void) | |||
668 | } | 668 | } |
669 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ | 669 | #endif /* !CONFIG_NEED_MULTIPLE_NODES */ |
670 | 670 | ||
671 | static void __init zone_sizes_init(void) | ||
672 | { | ||
673 | unsigned long max_zone_pfns[MAX_NR_ZONES]; | ||
674 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); | ||
675 | #ifdef CONFIG_ZONE_DMA | ||
676 | max_zone_pfns[ZONE_DMA] = | ||
677 | virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; | ||
678 | #endif | ||
679 | max_zone_pfns[ZONE_NORMAL] = max_low_pfn; | ||
680 | #ifdef CONFIG_HIGHMEM | ||
681 | max_zone_pfns[ZONE_HIGHMEM] = highend_pfn; | ||
682 | #endif | ||
683 | |||
684 | free_area_init_nodes(max_zone_pfns); | ||
685 | } | ||
686 | |||
687 | void __init setup_bootmem_allocator(void) | 671 | void __init setup_bootmem_allocator(void) |
688 | { | 672 | { |
689 | printk(KERN_INFO " mapped low ram: 0 - %08lx\n", | 673 | printk(KERN_INFO " mapped low ram: 0 - %08lx\n", |
@@ -754,6 +738,17 @@ void __init mem_init(void) | |||
754 | #ifdef CONFIG_FLATMEM | 738 | #ifdef CONFIG_FLATMEM |
755 | BUG_ON(!mem_map); | 739 | BUG_ON(!mem_map); |
756 | #endif | 740 | #endif |
741 | /* | ||
742 | * With CONFIG_DEBUG_PAGEALLOC initialization of highmem pages has to | ||
743 | * be done before free_all_bootmem(). Memblock use free low memory for | ||
744 | * temporary data (see find_range_array()) and for this purpose can use | ||
745 | * pages that was already passed to the buddy allocator, hence marked as | ||
746 | * not accessible in the page tables when compiled with | ||
747 | * CONFIG_DEBUG_PAGEALLOC. Otherwise order of initialization is not | ||
748 | * important here. | ||
749 | */ | ||
750 | set_highmem_pages_init(); | ||
751 | |||
757 | /* this will put all low memory onto the freelists */ | 752 | /* this will put all low memory onto the freelists */ |
758 | totalram_pages += free_all_bootmem(); | 753 | totalram_pages += free_all_bootmem(); |
759 | 754 | ||
@@ -765,8 +760,6 @@ void __init mem_init(void) | |||
765 | if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp))) | 760 | if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp))) |
766 | reservedpages++; | 761 | reservedpages++; |
767 | 762 | ||
768 | set_highmem_pages_init(); | ||
769 | |||
770 | codesize = (unsigned long) &_etext - (unsigned long) &_text; | 763 | codesize = (unsigned long) &_etext - (unsigned long) &_text; |
771 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | 764 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; |
772 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | 765 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; |