arch, mm: remove arch specific show_mem
We have a generic implementation for quite some time already. If there is any arch specific information to be printed then we should add a callback called from the generic code rather than duplicate the whole show_mem. The current code has resulted in the code duplication and the output divergence which is both confusing and adds maintainance costs. Let's just get rid of this mess. Link: http://lkml.kernel.org/r/20170117091543.25850-4-mhocko@kernel.org Signed-off-by: Michal Hocko <mhocko@suse.com> Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn> [UniCore32] Acked-by: Helge Deller <deller@gmx.de> [for parisc] Acked-by: Chris Metcalf <cmetcalf@mellanox.com> [for tile] Acked-by: Mel Gorman <mgorman@suse.de> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Hillf Danton <hillf.zj@alibaba-inc.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:

committed by
Linus Torvalds

parent
a8e99259e7
commit
6d23f8a5d4
@@ -57,50 +57,6 @@ early_param("initrd", early_initrd);
|
||||
*/
|
||||
struct meminfo meminfo;
|
||||
|
||||
void show_mem(unsigned int filter)
|
||||
{
|
||||
int free = 0, total = 0, reserved = 0;
|
||||
int shared = 0, cached = 0, slab = 0, i;
|
||||
struct meminfo *mi = &meminfo;
|
||||
|
||||
printk(KERN_DEFAULT "Mem-info:\n");
|
||||
show_free_areas(filter);
|
||||
|
||||
for_each_bank(i, mi) {
|
||||
struct membank *bank = &mi->bank[i];
|
||||
unsigned int pfn1, pfn2;
|
||||
struct page *page, *end;
|
||||
|
||||
pfn1 = bank_pfn_start(bank);
|
||||
pfn2 = bank_pfn_end(bank);
|
||||
|
||||
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;
|
||||
page++;
|
||||
} while (page < end);
|
||||
}
|
||||
|
||||
printk(KERN_DEFAULT "%d pages of RAM\n", total);
|
||||
printk(KERN_DEFAULT "%d free pages\n", free);
|
||||
printk(KERN_DEFAULT "%d reserved pages\n", reserved);
|
||||
printk(KERN_DEFAULT "%d slab pages\n", slab);
|
||||
printk(KERN_DEFAULT "%d pages shared\n", shared);
|
||||
printk(KERN_DEFAULT "%d pages swap cached\n", cached);
|
||||
}
|
||||
|
||||
static void __init find_limits(unsigned long *min, unsigned long *max_low,
|
||||
unsigned long *max_high)
|
||||
{
|
||||
|
Reference in New Issue
Block a user