]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/x86: use common help functions to free reserved pages
authorJiang Liu <liuj97@gmail.com>
Wed, 20 Mar 2013 04:07:16 +0000 (15:07 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 21 Mar 2013 05:33:48 +0000 (16:33 +1100)
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>
arch/x86/mm/init.c
arch/x86/mm/init_64.c

index 59b7fc453277399bd574dbde43b0bd8d295c9414..fdc5dca14fb35de5537765acca869ccfb447262d 100644 (file)
@@ -515,11 +515,8 @@ void free_init_pages(char *what, unsigned long begin, unsigned long end)
        printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10);
 
        for (; addr < end; addr += PAGE_SIZE) {
-               ClearPageReserved(virt_to_page(addr));
-               init_page_count(virt_to_page(addr));
                memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
-               free_page(addr);
-               totalram_pages++;
+               free_reserved_page(virt_to_page(addr));
        }
 #endif
 }
index dafdeb2a59380539d463af6a8ac28a3dc19a8d36..bcbe92412c58e620d2b1e0d8159e54c858e1eff7 100644 (file)
@@ -1067,10 +1067,9 @@ void __init mem_init(void)
 
        /* clear_bss() already clear the empty_zero_page */
 
-       reservedpages = 0;
-
-       /* this will put all low memory onto the freelists */
        register_page_bootmem_info();
+
+       /* this will put all memory onto the freelists */
        totalram_pages = free_all_bootmem();
 
        absent_pages = absent_pages_in_range(0, max_pfn);