]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mm/tile: use common help functions to free reserved pages
authorJiang Liu <liuj97@gmail.com>
Thu, 27 Jun 2013 23:51:45 +0000 (09:51 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:37:41 +0000 (16:37 +1000)
Use common help functions to free reserved pages.

Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: <sworddragon2@aol.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Jianguo Wu <wujianguo@huawei.com>
Cc: Joonsoo Kim <js1304@gmail.com>
Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: Michel Lespinasse <walken@google.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tang Chen <tangchen@cn.fujitsu.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/tile/mm/init.c

index 2749515a054784ad95b2329b2c4d25bbb5270b98..ccfeb3f2e769f5ae583662c4b910d5defd3ef747 100644 (file)
@@ -720,7 +720,7 @@ static void __init init_free_pfn_range(unsigned long start, unsigned long end)
                }
                init_page_count(page);
                __free_pages(page, order);
-               totalram_pages += count;
+               adjust_managed_page_count(page, count);
 
                page += count;
                pfn += count;
@@ -1024,16 +1024,13 @@ static void free_init_pages(char *what, unsigned long begin, unsigned long end)
                        pte_clear(&init_mm, addr, ptep);
                        continue;
                }
-               __ClearPageReserved(page);
-               init_page_count(page);
                if (pte_huge(*ptep))
                        BUG_ON(!kdata_huge);
                else
                        set_pte_at(&init_mm, addr, ptep,
                                   pfn_pte(pfn, PAGE_KERNEL));
                memset((void *)addr, POISON_FREE_INITMEM, PAGE_SIZE);
-               free_page(addr);
-               totalram_pages++;
+               free_reserved_page(page);
        }
        pr_info("Freeing %s: %ldk freed\n", what, (end - begin) >> 10);
 }