2013-03-10 06:33:51

by Jiang Liu

[permalink] [raw]
Subject: [PATCH v2, part1 29/29] mm,kexec: use common help functions to free reserved pages

Use common help functions to free reserved pages.

Signed-off-by: Jiang Liu <[email protected]>
Cc: Eric Biederman <[email protected]>
---
kernel/kexec.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/kexec.c b/kernel/kexec.c
index bddd3d7..be95397 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -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)
--
1.7.9.5


2013-03-11 05:21:18

by Zhang Yanfei

[permalink] [raw]
Subject: Re: [PATCH v2, part1 29/29] mm,kexec: use common help functions to free reserved pages

?? 2013??03??10?? 14:27, Jiang Liu ะด??:
> Use common help functions to free reserved pages.
>
> Signed-off-by: Jiang Liu <[email protected]>
> Cc: Eric Biederman <[email protected]>

Reviewed-by: Zhang Yanfei <[email protected]>

> ---
> kernel/kexec.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index bddd3d7..be95397 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -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)