mm,kexec: use common help functions to free reserved pages
authorJiang Liu <liuj97@gmail.com>
Mon, 29 Apr 2013 22:06:58 +0000 (15:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 29 Apr 2013 22:54:31 +0000 (15:54 -0700)
Use common help functions to free reserved pages.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Reviewed-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/kexec.c

index ffd4e111fd67e7d7b29199b6206957f6c458a350..b19181d4420151f5007766049f190435ffeef84b 100644 (file)
@@ -1118,12 +1118,8 @@ void __weak crash_free_reserved_phys_range(unsigned long begin,
 {
        unsigned long addr;
 
-       for (addr = begin; addr < end; addr += PAGE_SIZE) {
-               ClearPageReserved(pfn_to_page(addr >> PAGE_SHIFT));
-               init_page_count(pfn_to_page(addr >> PAGE_SHIFT));
-               free_page((unsigned long)__va(addr));
-               totalram_pages++;
-       }
+       for (addr = begin; addr < end; addr += PAGE_SIZE)
+               free_reserved_page(pfn_to_page(addr >> PAGE_SHIFT));
 }
 
 int crash_shrink_memory(unsigned long new_size)