mm/tile: use common help functions to free reserved pages
authorJiang Liu <[email protected]>
Wed, 3 Jul 2013 22:03:01 +0000 (15:03 -0700)
committerLinus Torvalds <[email protected]>
Wed, 3 Jul 2013 23:07:33 +0000 (16:07 -0700)
Use common help functions to free reserved pages.

Signed-off-by: Jiang Liu <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: Wen Congyang <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: David Howells <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jeremy Fitzhardinge <[email protected]>
Cc: Jianguo Wu <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Kamezawa Hiroyuki <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Michel Lespinasse <[email protected]>
Cc: Minchan Kim <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Tang Chen <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Yasuaki Ishimatsu <[email protected]>
Cc: Yinghai Lu <[email protected]>
Cc: Russell King <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
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);
 }