|
31 | 31 | static unsigned long max_gap; |
32 | 32 | #endif |
33 | 33 |
|
34 | | -/** |
35 | | - * show_mem - give short summary of memory stats |
36 | | - * |
37 | | - * Shows a simple page count of reserved and used pages in the system. |
38 | | - * For discontig machines, it does this on a per-pgdat basis. |
39 | | - */ |
40 | | -void show_mem(unsigned int filter) |
41 | | -{ |
42 | | - int i, total_reserved = 0; |
43 | | - int total_shared = 0, total_cached = 0; |
44 | | - unsigned long total_present = 0; |
45 | | - pg_data_t *pgdat; |
46 | | - |
47 | | - printk(KERN_INFO "Mem-info:\n"); |
48 | | - show_free_areas(filter); |
49 | | - printk(KERN_INFO "Node memory in pages:\n"); |
50 | | - if (filter & SHOW_MEM_FILTER_PAGE_COUNT) |
51 | | - return; |
52 | | - for_each_online_pgdat(pgdat) { |
53 | | - unsigned long present; |
54 | | - unsigned long flags; |
55 | | - int shared = 0, cached = 0, reserved = 0; |
56 | | - int nid = pgdat->node_id; |
57 | | - |
58 | | - if (skip_free_areas_node(filter, nid)) |
59 | | - continue; |
60 | | - pgdat_resize_lock(pgdat, &flags); |
61 | | - present = pgdat->node_present_pages; |
62 | | - for(i = 0; i < pgdat->node_spanned_pages; i++) { |
63 | | - struct page *page; |
64 | | - if (unlikely(i % MAX_ORDER_NR_PAGES == 0)) |
65 | | - touch_nmi_watchdog(); |
66 | | - if (pfn_valid(pgdat->node_start_pfn + i)) |
67 | | - page = pfn_to_page(pgdat->node_start_pfn + i); |
68 | | - else { |
69 | | -#ifdef CONFIG_VIRTUAL_MEM_MAP |
70 | | - if (max_gap < LARGE_GAP) |
71 | | - continue; |
72 | | -#endif |
73 | | - i = vmemmap_find_next_valid_pfn(nid, i) - 1; |
74 | | - continue; |
75 | | - } |
76 | | - if (PageReserved(page)) |
77 | | - reserved++; |
78 | | - else if (PageSwapCache(page)) |
79 | | - cached++; |
80 | | - else if (page_count(page)) |
81 | | - shared += page_count(page)-1; |
82 | | - } |
83 | | - pgdat_resize_unlock(pgdat, &flags); |
84 | | - total_present += present; |
85 | | - total_reserved += reserved; |
86 | | - total_cached += cached; |
87 | | - total_shared += shared; |
88 | | - printk(KERN_INFO "Node %4d: RAM: %11ld, rsvd: %8d, " |
89 | | - "shrd: %10d, swpd: %10d\n", nid, |
90 | | - present, reserved, shared, cached); |
91 | | - } |
92 | | - printk(KERN_INFO "%ld pages of RAM\n", total_present); |
93 | | - printk(KERN_INFO "%d reserved pages\n", total_reserved); |
94 | | - printk(KERN_INFO "%d pages shared\n", total_shared); |
95 | | - printk(KERN_INFO "%d pages swap cached\n", total_cached); |
96 | | - printk(KERN_INFO "Total of %ld pages in page table cache\n", |
97 | | - quicklist_total_size()); |
98 | | - printk(KERN_INFO "%ld free buffer pages\n", nr_free_buffer_pages()); |
99 | | -} |
100 | | - |
101 | | - |
102 | 34 | /* physical address where the bootmem map is located */ |
103 | 35 | unsigned long bootmap_start; |
104 | 36 |
|
|
0 commit comments