Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: switch to use the generic show_mem() implementation

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>

-49
-49
arch/arm/mm/init.c
··· 86 86 87 87 __tagtable(ATAG_INITRD2, parse_tag_initrd2); 88 88 89 - /* 90 - * This keeps memory configuration data used by a couple memory 91 - * initialization functions, as well as show_mem() for the skipping 92 - * of holes in the memory map. It is populated by arm_add_memory(). 93 - */ 94 - void show_mem(unsigned int filter) 95 - { 96 - int free = 0, total = 0, reserved = 0; 97 - int shared = 0, cached = 0, slab = 0; 98 - struct memblock_region *reg; 99 - 100 - printk("Mem-info:\n"); 101 - show_free_areas(filter); 102 - 103 - for_each_memblock (memory, reg) { 104 - unsigned int pfn1, pfn2; 105 - struct page *page, *end; 106 - 107 - pfn1 = memblock_region_memory_base_pfn(reg); 108 - pfn2 = memblock_region_memory_end_pfn(reg); 109 - 110 - page = pfn_to_page(pfn1); 111 - end = pfn_to_page(pfn2 - 1) + 1; 112 - 113 - do { 114 - total++; 115 - if (PageReserved(page)) 116 - reserved++; 117 - else if (PageSwapCache(page)) 118 - cached++; 119 - else if (PageSlab(page)) 120 - slab++; 121 - else if (!page_count(page)) 122 - free++; 123 - else 124 - shared += page_count(page) - 1; 125 - pfn1++; 126 - page = pfn_to_page(pfn1); 127 - } while (pfn1 < pfn2); 128 - } 129 - 130 - printk("%d pages of RAM\n", total); 131 - printk("%d free pages\n", free); 132 - printk("%d reserved pages\n", reserved); 133 - printk("%d slab pages\n", slab); 134 - printk("%d pages shared\n", shared); 135 - printk("%d pages swap cached\n", cached); 136 - } 137 - 138 89 static void __init find_limits(unsigned long *min, unsigned long *max_low, 139 90 unsigned long *max_high) 140 91 {