aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/mm/init_32.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 3bebaed5021c..a2fecb1611cc 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -744,6 +744,17 @@ void __init mem_init(void)
744#ifdef CONFIG_FLATMEM 744#ifdef CONFIG_FLATMEM
745 BUG_ON(!mem_map); 745 BUG_ON(!mem_map);
746#endif 746#endif
747 /*
748 * With CONFIG_DEBUG_PAGEALLOC initialization of highmem pages has to
749 * be done before free_all_bootmem(). Memblock use free low memory for
750 * temporary data (see find_range_array()) and for this purpose can use
751 * pages that was already passed to the buddy allocator, hence marked as
752 * not accessible in the page tables when compiled with
753 * CONFIG_DEBUG_PAGEALLOC. Otherwise order of initialization is not
754 * important here.
755 */
756 set_highmem_pages_init();
757
747 /* this will put all low memory onto the freelists */ 758 /* this will put all low memory onto the freelists */
748 totalram_pages += free_all_bootmem(); 759 totalram_pages += free_all_bootmem();
749 760
@@ -755,8 +766,6 @@ void __init mem_init(void)
755 if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp))) 766 if (page_is_ram(tmp) && PageReserved(pfn_to_page(tmp)))
756 reservedpages++; 767 reservedpages++;
757 768
758 set_highmem_pages_init();
759
760 codesize = (unsigned long) &_etext - (unsigned long) &_text; 769 codesize = (unsigned long) &_etext - (unsigned long) &_text;
761 datasize = (unsigned long) &_edata - (unsigned long) &_etext; 770 datasize = (unsigned long) &_edata - (unsigned long) &_etext;
762 initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; 771 initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;