diff options
author | George Beshers <gbeshers@sgi.com> | 2007-02-05 19:20:04 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2007-02-05 19:51:59 -0500 |
commit | f1c0afa2e8802c01cf82c915e2bb3cb2a81570d4 (patch) | |
tree | af867a8c57b025b4e149157c885a968b9126339d | |
parent | 671496affdb5228786896864c3f900f66563e8c1 (diff) |
[IA64] show_mem() for IA64 sparsemem NUMA
On the ia64 architecture only this patch upgrades show_mem() for sparse
memory to be the same as it was for discontig memory. It has been shown to
work on NUMA and flatmem architectures.
Signed-off-by: George Beshers <gbeshers@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
-rw-r--r-- | arch/ia64/mm/contig.c | 74 |
1 files changed, 48 insertions, 26 deletions
diff --git a/arch/ia64/mm/contig.c b/arch/ia64/mm/contig.c index ec8657bb5bd2..63e6d49c5813 100644 --- a/arch/ia64/mm/contig.c +++ b/arch/ia64/mm/contig.c | |||
@@ -30,47 +30,69 @@ static unsigned long max_gap; | |||
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | /** | 32 | /** |
33 | * show_mem - display a memory statistics summary | 33 | * show_mem - give short summary of memory stats |
34 | * | 34 | * |
35 | * Just walks the pages in the system and describes where they're allocated. | 35 | * Shows a simple page count of reserved and used pages in the system. |
36 | * For discontig machines, it does this on a per-pgdat basis. | ||
36 | */ | 37 | */ |
37 | void | 38 | void show_mem(void) |
38 | show_mem (void) | ||
39 | { | 39 | { |
40 | int i, total = 0, reserved = 0; | 40 | int i, total_reserved = 0; |
41 | int shared = 0, cached = 0; | 41 | int total_shared = 0, total_cached = 0; |
42 | unsigned long total_present = 0; | ||
43 | pg_data_t *pgdat; | ||
42 | 44 | ||
43 | printk(KERN_INFO "Mem-info:\n"); | 45 | printk(KERN_INFO "Mem-info:\n"); |
44 | show_free_areas(); | 46 | show_free_areas(); |
45 | |||
46 | printk(KERN_INFO "Free swap: %6ldkB\n", | 47 | printk(KERN_INFO "Free swap: %6ldkB\n", |
47 | nr_swap_pages<<(PAGE_SHIFT-10)); | 48 | nr_swap_pages<<(PAGE_SHIFT-10)); |
48 | i = max_mapnr; | 49 | printk(KERN_INFO "Node memory in pages:\n"); |
49 | for (i = 0; i < max_mapnr; i++) { | 50 | for_each_online_pgdat(pgdat) { |
50 | if (!pfn_valid(i)) { | 51 | unsigned long present; |
52 | unsigned long flags; | ||
53 | int shared = 0, cached = 0, reserved = 0; | ||
54 | |||
55 | pgdat_resize_lock(pgdat, &flags); | ||
56 | present = pgdat->node_present_pages; | ||
57 | for(i = 0; i < pgdat->node_spanned_pages; i++) { | ||
58 | struct page *page; | ||
59 | if (pfn_valid(pgdat->node_start_pfn + i)) | ||
60 | page = pfn_to_page(pgdat->node_start_pfn + i); | ||
61 | else { | ||
51 | #ifdef CONFIG_VIRTUAL_MEM_MAP | 62 | #ifdef CONFIG_VIRTUAL_MEM_MAP |
52 | if (max_gap < LARGE_GAP) | 63 | if (max_gap < LARGE_GAP) |
53 | continue; | 64 | continue; |
54 | i = vmemmap_find_next_valid_pfn(0, i) - 1; | ||
55 | #endif | 65 | #endif |
56 | continue; | 66 | i = vmemmap_find_next_valid_pfn(pgdat->node_id, |
67 | i) - 1; | ||
68 | continue; | ||
69 | } | ||
70 | if (PageReserved(page)) | ||
71 | reserved++; | ||
72 | else if (PageSwapCache(page)) | ||
73 | cached++; | ||
74 | else if (page_count(page)) | ||
75 | shared += page_count(page)-1; | ||
57 | } | 76 | } |
58 | total++; | 77 | pgdat_resize_unlock(pgdat, &flags); |
59 | if (PageReserved(mem_map+i)) | 78 | total_present += present; |
60 | reserved++; | 79 | total_reserved += reserved; |
61 | else if (PageSwapCache(mem_map+i)) | 80 | total_cached += cached; |
62 | cached++; | 81 | total_shared += shared; |
63 | else if (page_count(mem_map + i)) | 82 | printk(KERN_INFO "Node %4d: RAM: %11ld, rsvd: %8d, " |
64 | shared += page_count(mem_map + i) - 1; | 83 | "shrd: %10d, swpd: %10d\n", pgdat->node_id, |
84 | present, reserved, shared, cached); | ||
65 | } | 85 | } |
66 | printk(KERN_INFO "%d pages of RAM\n", total); | 86 | printk(KERN_INFO "%ld pages of RAM\n", total_present); |
67 | printk(KERN_INFO "%d reserved pages\n", reserved); | 87 | printk(KERN_INFO "%d reserved pages\n", total_reserved); |
68 | printk(KERN_INFO "%d pages shared\n", shared); | 88 | printk(KERN_INFO "%d pages shared\n", total_shared); |
69 | printk(KERN_INFO "%d pages swap cached\n", cached); | 89 | printk(KERN_INFO "%d pages swap cached\n", total_cached); |
70 | printk(KERN_INFO "%ld pages in page table cache\n", | 90 | printk(KERN_INFO "Total of %ld pages in page table cache\n", |
71 | pgtable_quicklist_total_size()); | 91 | pgtable_quicklist_total_size()); |
92 | printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); | ||
72 | } | 93 | } |
73 | 94 | ||
95 | |||
74 | /* physical address where the bootmem map is located */ | 96 | /* physical address where the bootmem map is located */ |
75 | unsigned long bootmap_start; | 97 | unsigned long bootmap_start; |
76 | 98 | ||