aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiang Liu <liuj97@gmail.com>2013-04-29 18:06:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:54:31 -0400
commitbced0e32f6bdf4e2584bc9df58e3fbebaaf42bef (patch)
treedf48e08865fea4fb267e3a9c17ef93bc4e0f89d6
parentccecb510a9b58f1e30a45f35897842f915c24c62 (diff)
mm/x86: use common help functions to free reserved pages
Use common help functions to free reserved pages. Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--arch/x86/mm/init.c5
-rw-r--r--arch/x86/mm/init_64.c5
2 files changed, 3 insertions, 7 deletions
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 59b7fc453277..fdc5dca14fb3 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -515,11 +515,8 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
515 printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10); 515 printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10);
516 516
517 for (; addr < end; addr += PAGE_SIZE) { 517 for (; addr < end; addr += PAGE_SIZE) {
518 ClearPageReserved(virt_to_page(addr));
519 init_page_count(virt_to_page(addr));
520 memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE); 518 memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
521 free_page(addr); 519 free_reserved_page(virt_to_page(addr));
522 totalram_pages++;
523 } 520 }
524#endif 521#endif
525} 522}
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 474e28f10815..2ef81f19bd6c 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -1067,10 +1067,9 @@ void __init mem_init(void)
1067 1067
1068 /* clear_bss() already clear the empty_zero_page */ 1068 /* clear_bss() already clear the empty_zero_page */
1069 1069
1070 reservedpages = 0;
1071
1072 /* this will put all low memory onto the freelists */
1073 register_page_bootmem_info(); 1070 register_page_bootmem_info();
1071
1072 /* this will put all memory onto the freelists */
1074 totalram_pages = free_all_bootmem(); 1073 totalram_pages = free_all_bootmem();
1075 1074
1076 absent_pages = absent_pages_in_range(0, max_pfn); 1075 absent_pages = absent_pages_in_range(0, max_pfn);