Skip to content

Commit e07cee2

Browse files
jiangliutorvalds
authored andcommitted
mm,kexec: 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: 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>
1 parent c941836 commit e07cee2

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

‎kernel/kexec.c‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,12 +1118,8 @@ void __weak crash_free_reserved_phys_range(unsigned long begin,
11181118
{
11191119
unsigned long addr;
11201120

1121-
for (addr = begin; addr < end; addr += PAGE_SIZE) {
1122-
ClearPageReserved(pfn_to_page(addr >> PAGE_SHIFT));
1123-
init_page_count(pfn_to_page(addr >> PAGE_SHIFT));
1124-
free_page((unsigned long)__va(addr));
1125-
totalram_pages++;
1126-
}
1121+
for (addr = begin; addr < end; addr += PAGE_SIZE)
1122+
free_reserved_page(pfn_to_page(addr >> PAGE_SHIFT));
11271123
}
11281124

11291125
int crash_shrink_memory(unsigned long new_size)

0 commit comments

Comments
 (0)