Root/
1 | /* |
2 | * Generic show_mem() implementation |
3 | * |
4 | * Copyright (C) 2008 Johannes Weiner <hannes@saeurebad.de> |
5 | * All code subject to the GPL version 2. |
6 | */ |
7 | |
8 | #include <linux/mm.h> |
9 | #include <linux/nmi.h> |
10 | #include <linux/quicklist.h> |
11 | |
12 | void show_mem(unsigned int filter) |
13 | { |
14 | pg_data_t *pgdat; |
15 | unsigned long total = 0, reserved = 0, shared = 0, |
16 | nonshared = 0, highmem = 0; |
17 | |
18 | printk("Mem-Info:\n"); |
19 | show_free_areas(filter); |
20 | |
21 | if (filter & SHOW_MEM_FILTER_PAGE_COUNT) |
22 | return; |
23 | |
24 | for_each_online_pgdat(pgdat) { |
25 | unsigned long i, flags; |
26 | |
27 | pgdat_resize_lock(pgdat, &flags); |
28 | for (i = 0; i < pgdat->node_spanned_pages; i++) { |
29 | struct page *page; |
30 | unsigned long pfn = pgdat->node_start_pfn + i; |
31 | |
32 | if (unlikely(!(i % MAX_ORDER_NR_PAGES))) |
33 | touch_nmi_watchdog(); |
34 | |
35 | if (!pfn_valid(pfn)) |
36 | continue; |
37 | |
38 | page = pfn_to_page(pfn); |
39 | |
40 | if (PageHighMem(page)) |
41 | highmem++; |
42 | |
43 | if (PageReserved(page)) |
44 | reserved++; |
45 | else if (page_count(page) == 1) |
46 | nonshared++; |
47 | else if (page_count(page) > 1) |
48 | shared += page_count(page) - 1; |
49 | |
50 | total++; |
51 | } |
52 | pgdat_resize_unlock(pgdat, &flags); |
53 | } |
54 | |
55 | printk("%lu pages RAM\n", total); |
56 | #ifdef CONFIG_HIGHMEM |
57 | printk("%lu pages HighMem\n", highmem); |
58 | #endif |
59 | printk("%lu pages reserved\n", reserved); |
60 | printk("%lu pages shared\n", shared); |
61 | printk("%lu pages non-shared\n", nonshared); |
62 | #ifdef CONFIG_QUICKLIST |
63 | printk("%lu pages in pagetable cache\n", |
64 | quicklist_total_size()); |
65 | #endif |
66 | } |
67 |
Branches:
ben-wpan
ben-wpan-stefan
javiroman/ks7010
jz-2.6.34
jz-2.6.34-rc5
jz-2.6.34-rc6
jz-2.6.34-rc7
jz-2.6.35
jz-2.6.36
jz-2.6.37
jz-2.6.38
jz-2.6.39
jz-3.0
jz-3.1
jz-3.11
jz-3.12
jz-3.13
jz-3.15
jz-3.16
jz-3.18-dt
jz-3.2
jz-3.3
jz-3.4
jz-3.5
jz-3.6
jz-3.6-rc2-pwm
jz-3.9
jz-3.9-clk
jz-3.9-rc8
jz47xx
jz47xx-2.6.38
master
Tags:
od-2011-09-04
od-2011-09-18
v2.6.34-rc5
v2.6.34-rc6
v2.6.34-rc7
v3.9