diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2008-05-30 04:03:29 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-05-30 04:03:34 -0400 |
commit | c1bb7f31eaef6ed6b9f895b99d9ea12e6b853606 (patch) | |
tree | 3792e69ae8386707a483e64b377aeac51439f358 /arch/s390 | |
parent | 1760537b69123905bf4f4b56f5746ae4547e9694 (diff) |
[S390] showmem: Only walk spanned pages.
Convert show_mem() so its nearly the same as on x86/powerpc.
Gives us proper locking and we get also rid of the only use of max_mapnr.
Also the number of pages was contained in an int which might not be
sufficient not too far in the future.
Cc: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/mm/init.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 29f3a63806b9..05598649b326 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
@@ -44,37 +44,34 @@ char empty_zero_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE))); | |||
44 | 44 | ||
45 | void show_mem(void) | 45 | void show_mem(void) |
46 | { | 46 | { |
47 | int i, total = 0, reserved = 0; | 47 | unsigned long i, total = 0, reserved = 0; |
48 | int shared = 0, cached = 0; | 48 | unsigned long shared = 0, cached = 0; |
49 | unsigned long flags; | ||
49 | struct page *page; | 50 | struct page *page; |
51 | pg_data_t *pgdat; | ||
50 | 52 | ||
51 | printk("Mem-info:\n"); | 53 | printk("Mem-info:\n"); |
52 | show_free_areas(); | 54 | show_free_areas(); |
53 | i = max_mapnr; | 55 | for_each_online_pgdat(pgdat) { |
54 | while (i-- > 0) { | 56 | pgdat_resize_lock(pgdat, &flags); |
55 | if (!pfn_valid(i)) | 57 | for (i = 0; i < pgdat->node_spanned_pages; i++) { |
56 | continue; | 58 | if (!pfn_valid(pgdat->node_start_pfn + i)) |
57 | page = pfn_to_page(i); | 59 | continue; |
58 | total++; | 60 | page = pfn_to_page(pgdat->node_start_pfn + i); |
59 | if (PageReserved(page)) | 61 | total++; |
60 | reserved++; | 62 | if (PageReserved(page)) |
61 | else if (PageSwapCache(page)) | 63 | reserved++; |
62 | cached++; | 64 | else if (PageSwapCache(page)) |
63 | else if (page_count(page)) | 65 | cached++; |
64 | shared += page_count(page) - 1; | 66 | else if (page_count(page)) |
67 | shared += page_count(page) - 1; | ||
68 | } | ||
69 | pgdat_resize_unlock(pgdat, &flags); | ||
65 | } | 70 | } |
66 | printk("%d pages of RAM\n", total); | 71 | printk("%ld pages of RAM\n", total); |
67 | printk("%d reserved pages\n", reserved); | 72 | printk("%ld reserved pages\n", reserved); |
68 | printk("%d pages shared\n", shared); | 73 | printk("%ld pages shared\n", shared); |
69 | printk("%d pages swap cached\n", cached); | 74 | printk("%ld pages swap cached\n", cached); |
70 | |||
71 | printk("%lu pages dirty\n", global_page_state(NR_FILE_DIRTY)); | ||
72 | printk("%lu pages writeback\n", global_page_state(NR_WRITEBACK)); | ||
73 | printk("%lu pages mapped\n", global_page_state(NR_FILE_MAPPED)); | ||
74 | printk("%lu pages slab\n", | ||
75 | global_page_state(NR_SLAB_RECLAIMABLE) + | ||
76 | global_page_state(NR_SLAB_UNRECLAIMABLE)); | ||
77 | printk("%lu pages pagetables\n", global_page_state(NR_PAGETABLE)); | ||
78 | } | 75 | } |
79 | 76 | ||
80 | /* | 77 | /* |