powerpc/eeh: Fix PE#0 check in eeh_add_to_parent_pe()
[linux/fpc-iii.git] / lib / show_mem.c
blobadc98e1825ba0d6df09623595253f5d9f4af9a73
1 /*
2 * Generic show_mem() implementation
4 * Copyright (C) 2008 Johannes Weiner <hannes@saeurebad.de>
5 * All code subject to the GPL version 2.
6 */
8 #include <linux/mm.h>
9 #include <linux/quicklist.h>
10 #include <linux/cma.h>
12 void show_mem(unsigned int filter)
14 pg_data_t *pgdat;
15 unsigned long total = 0, reserved = 0, highmem = 0;
17 printk("Mem-Info:\n");
18 show_free_areas(filter);
20 for_each_online_pgdat(pgdat) {
21 unsigned long flags;
22 int zoneid;
24 pgdat_resize_lock(pgdat, &flags);
25 for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) {
26 struct zone *zone = &pgdat->node_zones[zoneid];
27 if (!populated_zone(zone))
28 continue;
30 total += zone->present_pages;
31 reserved += zone->present_pages - zone->managed_pages;
33 if (is_highmem_idx(zoneid))
34 highmem += zone->present_pages;
36 pgdat_resize_unlock(pgdat, &flags);
39 printk("%lu pages RAM\n", total);
40 printk("%lu pages HighMem/MovableOnly\n", highmem);
41 #ifdef CONFIG_CMA
42 printk("%lu pages reserved\n", (reserved - totalcma_pages));
43 printk("%lu pages cma reserved\n", totalcma_pages);
44 #else
45 printk("%lu pages reserved\n", reserved);
46 #endif
47 #ifdef CONFIG_QUICKLIST
48 printk("%lu pages in pagetable cache\n",
49 quicklist_total_size());
50 #endif
51 #ifdef CONFIG_MEMORY_FAILURE
52 printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages));
53 #endif