ARM: switch to use the generic show_mem() implementation
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 26 Mar 2015 11:43:51 +0000 (11:43 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 14 Apr 2015 21:28:06 +0000 (22:28 +0100)
Switch ARM to use the generic show_mem() implementation, which displays
the statistics from the mm zone rather than walking the page arrays.

Acked-by: Mel Gorman <mgorman <mgorman@suse.de>
Tested-by: Gregory Fong <gregory.0xf0@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mm/init.c

index 1609b02..ae369c1 100644 (file)
@@ -86,55 +86,6 @@ static int __init parse_tag_initrd2(const struct tag *tag)
 
 __tagtable(ATAG_INITRD2, parse_tag_initrd2);
 
-/*
- * This keeps memory configuration data used by a couple memory
- * initialization functions, as well as show_mem() for the skipping
- * of holes in the memory map.  It is populated by arm_add_memory().
- */
-void show_mem(unsigned int filter)
-{
-       int free = 0, total = 0, reserved = 0;
-       int shared = 0, cached = 0, slab = 0;
-       struct memblock_region *reg;
-
-       printk("Mem-info:\n");
-       show_free_areas(filter);
-
-       for_each_memblock (memory, reg) {
-               unsigned int pfn1, pfn2;
-               struct page *page, *end;
-
-               pfn1 = memblock_region_memory_base_pfn(reg);
-               pfn2 = memblock_region_memory_end_pfn(reg);
-
-               page = pfn_to_page(pfn1);
-               end  = pfn_to_page(pfn2 - 1) + 1;
-
-               do {
-                       total++;
-                       if (PageReserved(page))
-                               reserved++;
-                       else if (PageSwapCache(page))
-                               cached++;
-                       else if (PageSlab(page))
-                               slab++;
-                       else if (!page_count(page))
-                               free++;
-                       else
-                               shared += page_count(page) - 1;
-                       pfn1++;
-                       page = pfn_to_page(pfn1);
-               } while (pfn1 < pfn2);
-       }
-
-       printk("%d pages of RAM\n", total);
-       printk("%d free pages\n", free);
-       printk("%d reserved pages\n", reserved);
-       printk("%d slab pages\n", slab);
-       printk("%d pages shared\n", shared);
-       printk("%d pages swap cached\n", cached);
-}
-
 static void __init find_limits(unsigned long *min, unsigned long *max_low,
                               unsigned long *max_high)
 {