tree dd0451607917958c22ab9f4fe2f0672478087178
parent 20216fc86d83e5e96fca7fa8d22de94d294695eb
author Miles Bader <[EMAIL PROTECTED]> Fri, 02 Sep 2005 15:13:31 +0900
committer Linus Torvalds <[EMAIL PROTECTED]> Fri, 02 Sep 2005 14:57:31 -0700

[PATCH] v850: Add show_mem

Signed-off-by: Miles Bader <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 arch/v850/kernel/setup.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+)

diff --git a/arch/v850/kernel/setup.c b/arch/v850/kernel/setup.c
--- a/arch/v850/kernel/setup.c
+++ b/arch/v850/kernel/setup.c
@@ -294,3 +294,33 @@ init_mem_alloc (unsigned long ram_start,
        free_area_init_node (0, NODE_DATA(0), zones_size,
                             ADDR_TO_PAGE (PAGE_OFFSET), 0);
 }
+
+
+
+/* Taken from m68knommu */
+void show_mem(void)
+{
+    unsigned long i;
+    int free = 0, total = 0, reserved = 0, shared = 0;
+    int cached = 0;
+
+    printk(KERN_INFO "\nMem-info:\n");
+    show_free_areas();
+    i = max_mapnr;
+    while (i-- > 0) {
+       total++;
+       if (PageReserved(mem_map+i))
+           reserved++;
+       else if (PageSwapCache(mem_map+i))
+           cached++;
+       else if (!page_count(mem_map+i))
+           free++;
+       else
+           shared += page_count(mem_map+i) - 1;
+    }
+    printk(KERN_INFO "%d pages of RAM\n",total);
+    printk(KERN_INFO "%d free pages\n",free);
+    printk(KERN_INFO "%d reserved pages\n",reserved);
+    printk(KERN_INFO "%d pages shared\n",shared);
+    printk(KERN_INFO "%d pages swap cached\n",cached);
+}
-
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