Blame view
lib/show_mem.c
1.24 KB
454c63b02
|
1 2 3 4 5 6 7 8 |
/* * Generic show_mem() implementation * * Copyright (C) 2008 Johannes Weiner <hannes@saeurebad.de> * All code subject to the GPL version 2. */ #include <linux/mm.h> |
454c63b02
|
9 |
#include <linux/quicklist.h> |
49abd8c28
|
10 |
#include <linux/cma.h> |
454c63b02
|
11 |
|
b2b755b5f
|
12 |
void show_mem(unsigned int filter) |
454c63b02
|
13 14 |
{ pg_data_t *pgdat; |
c78e93630
|
15 |
unsigned long total = 0, reserved = 0, highmem = 0; |
454c63b02
|
16 |
|
f047f4f37
|
17 18 |
printk("Mem-Info: "); |
7bf02ea22
|
19 |
show_free_areas(filter); |
454c63b02
|
20 21 |
for_each_online_pgdat(pgdat) { |
c78e93630
|
22 23 |
unsigned long flags; int zoneid; |
454c63b02
|
24 25 |
pgdat_resize_lock(pgdat, &flags); |
c78e93630
|
26 27 28 |
for (zoneid = 0; zoneid < MAX_NR_ZONES; zoneid++) { struct zone *zone = &pgdat->node_zones[zoneid]; if (!populated_zone(zone)) |
454c63b02
|
29 |
continue; |
c78e93630
|
30 |
total += zone->present_pages; |
bc127bda3
|
31 |
reserved += zone->present_pages - zone->managed_pages; |
454c63b02
|
32 |
|
c78e93630
|
33 34 |
if (is_highmem_idx(zoneid)) highmem += zone->present_pages; |
454c63b02
|
35 36 37 |
} pgdat_resize_unlock(pgdat, &flags); } |
f047f4f37
|
38 39 |
printk("%lu pages RAM ", total); |
c78e93630
|
40 41 |
printk("%lu pages HighMem/MovableOnly ", highmem); |
156408c0e
|
42 43 |
printk("%lu pages reserved ", reserved); |
49abd8c28
|
44 |
#ifdef CONFIG_CMA |
49abd8c28
|
45 46 |
printk("%lu pages cma reserved ", totalcma_pages); |
49abd8c28
|
47 |
#endif |
454c63b02
|
48 |
#ifdef CONFIG_QUICKLIST |
f047f4f37
|
49 50 |
printk("%lu pages in pagetable cache ", |
454c63b02
|
51 52 |
quicklist_total_size()); #endif |
25487d73a
|
53 54 55 56 |
#ifdef CONFIG_MEMORY_FAILURE printk("%lu pages hwpoisoned ", atomic_long_read(&num_poisoned_pages)); #endif |
454c63b02
|
57 |
} |