Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5be4a963675d3270fab7f55e8c4a2e56afd408f6
Commit:     5be4a963675d3270fab7f55e8c4a2e56afd408f6
Parent:     28256ca2e04c72eee1e83524d7f78ce5646030e2
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 15 16:00:29 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Apr 26 01:55:30 2007 -0700

    [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 <[EMAIL PROTECTED]>
---
 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 6fa78c5..97b5ebc 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)
 
 void show_mem(void)
 {
+       unsigned long total = 0, reserved = 0;
+       unsigned long shared = 0, cached = 0;
+       pg_data_t *pgdat;
+
        printk(KERN_INFO "Mem-info:\n");
        show_free_areas();
        printk(KERN_INFO "Free swap:       %6ldkB\n",
               nr_swap_pages << (PAGE_SHIFT-10));
-       printk(KERN_INFO "%ld pages of RAM\n", num_physpages);
-       printk(KERN_INFO "%lu free pages\n", nr_free_pages());
+       for_each_online_pgdat(pgdat) {
+               unsigned long i, flags;
+
+               pgdat_resize_lock(pgdat, &flags);
+               for (i = 0; i < pgdat->node_spanned_pages; i++) {
+                       struct page *page = pgdat_page_nr(pgdat, i);
+                       total++;
+                       if (PageReserved(page))
+                               reserved++;
+                       else if (PageSwapCache(page))
+                               cached++;
+                       else if (page_count(page))
+                               shared += page_count(page) - 1;
+               }
+               pgdat_resize_unlock(pgdat, &flags);
+       }
+
+       printk(KERN_INFO "%lu pages of RAM\n", total);
+       printk(KERN_INFO "%lu reserved pages\n", reserved);
+       printk(KERN_INFO "%lu pages shared\n", shared);
+       printk(KERN_INFO "%lu pages swap cached\n", cached);
+
+       printk(KERN_INFO "%lu pages dirty\n",
+              global_page_state(NR_FILE_DIRTY));
+       printk(KERN_INFO "%lu pages writeback\n",
+              global_page_state(NR_WRITEBACK));
+       printk(KERN_INFO "%lu pages mapped\n",
+              global_page_state(NR_FILE_MAPPED));
+       printk(KERN_INFO "%lu pages slab\n",
+               global_page_state(NR_SLAB_RECLAIMABLE) +
+               global_page_state(NR_SLAB_UNRECLAIMABLE));
+       printk(KERN_INFO "%lu pages pagetables\n",
+              global_page_state(NR_PAGETABLE));
 }
 
 void mmu_info(struct seq_file *m)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to