2 * Generic show_mem() implementation
4 * Copyright (C) 2008 Johannes Weiner <hannes@saeurebad.de>
5 * All code subject to the GPL version 2.
10 #include <linux/quicklist.h>
12 void show_mem(unsigned int filter)
15 unsigned long total = 0, reserved = 0, highmem = 0;
17 printk("Mem-Info:\n");
18 show_free_areas(filter);
20 if (filter & SHOW_MEM_FILTER_PAGE_COUNT)
23 for_each_online_pgdat(pgdat) {
27 pgdat_resize_lock(pgdat, &flags);
28 for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
29 struct zone *zone = &pgdat->node_zones[zoneid];
30 if (!populated_zone(zone))
33 total += zone->present_pages;
34 reserved = zone->present_pages - zone->managed_pages;
36 if (is_highmem_idx(zoneid))
37 highmem += zone->present_pages;
39 pgdat_resize_unlock(pgdat, &flags);
42 printk("%lu pages RAM\n", total);
43 printk("%lu pages HighMem/MovableOnly\n", highmem);
44 printk("%lu pages reserved\n", reserved);
45 #ifdef CONFIG_QUICKLIST
46 printk("%lu pages in pagetable cache\n",
47 quicklist_total_size());