diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-03-15 19:00:29 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 04:55:30 -0400 |
commit | 5be4a963675d3270fab7f55e8c4a2e56afd408f6 (patch) | |
tree | 7fef3ded1d1dfcda94a47f423b2a74126b837557 | |
parent | 28256ca2e04c72eee1e83524d7f78ce5646030e2 (diff) |
[SPARC64]: Give move verbose show_mem() output just like i386.
We now report everything i386 does except for highmem which
doesn't apply.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/sparc64/mm/init.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 6fa78c5a30c4..97b5ebc91165 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -421,12 +421,47 @@ void __kprobes flush_icache_range(unsigned long start, unsigned long end) | |||
421 | 421 | ||
422 | void show_mem(void) | 422 | void show_mem(void) |
423 | { | 423 | { |
424 | unsigned long total = 0, reserved = 0; | ||
425 | unsigned long shared = 0, cached = 0; | ||
426 | pg_data_t *pgdat; | ||
427 | |||
424 | printk(KERN_INFO "Mem-info:\n"); | 428 | printk(KERN_INFO "Mem-info:\n"); |
425 | show_free_areas(); | 429 | show_free_areas(); |
426 | printk(KERN_INFO "Free swap: %6ldkB\n", | 430 | printk(KERN_INFO "Free swap: %6ldkB\n", |
427 | nr_swap_pages << (PAGE_SHIFT-10)); | 431 | nr_swap_pages << (PAGE_SHIFT-10)); |
428 | printk(KERN_INFO "%ld pages of RAM\n", num_physpages); | 432 | for_each_online_pgdat(pgdat) { |
429 | printk(KERN_INFO "%lu free pages\n", nr_free_pages()); | 433 | unsigned long i, flags; |
434 | |||
435 | pgdat_resize_lock(pgdat, &flags); | ||
436 | for (i = 0; i < pgdat->node_spanned_pages; i++) { | ||
437 | struct page *page = pgdat_page_nr(pgdat, i); | ||
438 | total++; | ||
439 | if (PageReserved(page)) | ||
440 | reserved++; | ||
441 | else if (PageSwapCache(page)) | ||
442 | cached++; | ||
443 | else if (page_count(page)) | ||
444 | shared += page_count(page) - 1; | ||
445 | } | ||
446 | pgdat_resize_unlock(pgdat, &flags); | ||
447 | } | ||
448 | |||
449 | printk(KERN_INFO "%lu pages of RAM\n", total); | ||
450 | printk(KERN_INFO "%lu reserved pages\n", reserved); | ||
451 | printk(KERN_INFO "%lu pages shared\n", shared); | ||
452 | printk(KERN_INFO "%lu pages swap cached\n", cached); | ||
453 | |||
454 | printk(KERN_INFO "%lu pages dirty\n", | ||
455 | global_page_state(NR_FILE_DIRTY)); | ||
456 | printk(KERN_INFO "%lu pages writeback\n", | ||
457 | global_page_state(NR_WRITEBACK)); | ||
458 | printk(KERN_INFO "%lu pages mapped\n", | ||
459 | global_page_state(NR_FILE_MAPPED)); | ||
460 | printk(KERN_INFO "%lu pages slab\n", | ||
461 | global_page_state(NR_SLAB_RECLAIMABLE) + | ||
462 | global_page_state(NR_SLAB_UNRECLAIMABLE)); | ||
463 | printk(KERN_INFO "%lu pages pagetables\n", | ||
464 | global_page_state(NR_PAGETABLE)); | ||
430 | } | 465 | } |
431 | 466 | ||
432 | void mmu_info(struct seq_file *m) | 467 | void mmu_info(struct seq_file *m) |