public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Miles Bader <miles@gnu.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: [PATCH] v850: Add show_mem
Date: Fri,  2 Sep 2005 15:13:31 +0900 (JST)	[thread overview]
Message-ID: <20050902061331.0197149B@dhapc248.dev.necel.com> (raw)

Signed-off-by: Miles Bader <miles@gnu.org>

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

diff -ruN -X../cludes linux-2.6.13-uc0/arch/v850/kernel/setup.c linux-2.6.13-uc0-v850-20050902/arch/v850/kernel/setup.c
--- linux-2.6.13-uc0/arch/v850/kernel/setup.c	2005-06-21 16:07:27.095352000 +0900
+++ linux-2.6.13-uc0-v850-20050902/arch/v850/kernel/setup.c	2005-09-02 11:10:57.162581000 +0900
@@ -284,3 +294,33 @@
 	free_area_init_node (0, NODE_DATA(0), zones_size,
 			     ADDR_TO_PAGE (PAGE_OFFSET), 0);
 }
+
+\f
+
+/* 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);
+}

                 reply	other threads:[~2005-09-02  6:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050902061331.0197149B@dhapc248.dev.necel.com \
    --to=miles@gnu.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox