Commit 66f62594 authored by Jiang Liu's avatar Jiang Liu Committed by Linus Torvalds

mm/IA64: use common help functions to free reserved pages

Use common help functions to free reserved pages.
Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0f97580d
...@@ -154,25 +154,14 @@ ia64_init_addr_space (void) ...@@ -154,25 +154,14 @@ ia64_init_addr_space (void)
void void
free_initmem (void) free_initmem (void)
{ {
unsigned long addr, eaddr; free_reserved_area((unsigned long)ia64_imva(__init_begin),
(unsigned long)ia64_imva(__init_end),
addr = (unsigned long) ia64_imva(__init_begin); 0, "unused kernel");
eaddr = (unsigned long) ia64_imva(__init_end);
while (addr < eaddr) {
ClearPageReserved(virt_to_page(addr));
init_page_count(virt_to_page(addr));
free_page(addr);
++totalram_pages;
addr += PAGE_SIZE;
}
printk(KERN_INFO "Freeing unused kernel memory: %ldkB freed\n",
(__init_end - __init_begin) >> 10);
} }
void __init void __init
free_initrd_mem (unsigned long start, unsigned long end) free_initrd_mem (unsigned long start, unsigned long end)
{ {
struct page *page;
/* /*
* EFI uses 4KB pages while the kernel can use 4KB or bigger. * EFI uses 4KB pages while the kernel can use 4KB or bigger.
* Thus EFI and the kernel may have different page sizes. It is * Thus EFI and the kernel may have different page sizes. It is
...@@ -213,11 +202,7 @@ free_initrd_mem (unsigned long start, unsigned long end) ...@@ -213,11 +202,7 @@ free_initrd_mem (unsigned long start, unsigned long end)
for (; start < end; start += PAGE_SIZE) { for (; start < end; start += PAGE_SIZE) {
if (!virt_addr_valid(start)) if (!virt_addr_valid(start))
continue; continue;
page = virt_to_page(start); free_reserved_page(virt_to_page(start));
ClearPageReserved(page);
init_page_count(page);
free_page(start);
++totalram_pages;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment