2 * Generic show_mem() implementation
5 * All code subject to the GPL version 2.
10 #include <linux/quicklist.h>
11 #include <linux/cma.h>
13 void show_mem(unsigned int filter)
16 unsigned long total = 0, reserved = 0, highmem = 0;
18 printk("Mem-Info:\n");
19 show_free_areas(filter);
21 for_each_online_pgdat(pgdat) {
25 pgdat_resize_lock(pgdat, &flags);
26 for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
27 struct zone *zone = &pgdat->node_zones[zoneid];
28 if (!populated_zone(zone))
31 total += zone->present_pages;
32 reserved += zone->present_pages - zone->managed_pages;
34 if (is_highmem_idx(zoneid))
35 highmem += zone->present_pages;
37 pgdat_resize_unlock(pgdat, &flags);
40 printk("%lu pages RAM\n", total);
41 printk("%lu pages HighMem/MovableOnly\n", highmem);
43 printk("%lu pages reserved\n", (reserved - totalcma_pages));
44 printk("%lu pages cma reserved\n", totalcma_pages);
46 printk("%lu pages reserved\n", reserved);
48 #ifdef CONFIG_QUICKLIST
49 printk("%lu pages in pagetable cache\n",
50 quicklist_total_size());
52 #ifdef CONFIG_MEMORY_FAILURE
53 printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages));