linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Ben LaHaise <bcrl@redhat.com>
To: linux-mm@kvack.org
Subject: [PATCH] /proc/meminfo (fwd)
Date: Wed, 5 Sep 2001 15:38:57 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.33.0109051538400.16684-100000@toomuch.toronto.redhat.com> (raw)

Oops, forgot to cc linux-mm.

		-ben

-- 
"The world would be a better place if Larry Wall had been born in
Iceland, or any other country where the native language actually
has syntax" -- Peter da Silva

---------- Forwarded message ----------
Date: Wed, 5 Sep 2001 15:26:36 -0400 (EDT)
From: Ben LaHaise <bcrl@redhat.com>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Arjan van de Ven <arjanv@redhat.com>
Subject: [PATCH] /proc/meminfo

Heyo,

Below is a patch to fix overflows in /proc/meminfo on machines with lots
of highmem.  I wish I had 64GB.  Dell was right -- I was reading the
MemTotal: line automatically instead of Mem:.

		-ben

diff -urN v2.4.9-ac8/fs/proc/proc_misc.c work-v2.4.9-ac8/fs/proc/proc_misc.c
--- v2.4.9-ac8/fs/proc/proc_misc.c	Wed Sep  5 15:13:56 2001
+++ work-v2.4.9-ac8/fs/proc/proc_misc.c	Wed Sep  5 15:16:47 2001
@@ -147,13 +147,13 @@
 /*
  * display in kilobytes.
  */
-#define K(x) ((x) << (PAGE_SHIFT - 10))
-#define B(x) ((x) << PAGE_SHIFT)
+#define K(x) ((unsigned long)(x) << (PAGE_SHIFT - 10))
+#define B(x) ((unsigned long long)(x) << PAGE_SHIFT)
 	si_meminfo(&i);
 	si_swapinfo(&i);
 	len = sprintf(page, "        total:    used:    free:  shared: buffers:  cached:\n"
-		"Mem:  %8lu %8lu %8lu %8lu %8lu %8u\n"
-		"Swap: %8lu %8lu %8lu\n",
+		"Mem:  %8Lu %8Lu %8Lu %8Lu %8Lu %8Lu\n"
+		"Swap: %8Lu %8Lu %8Lu\n",
 		B(i.totalram), B(i.totalram-i.freeram), B(i.freeram),
 		B(i.sharedram), B(i.bufferram),
 		B(cached), B(i.totalswap),
@@ -170,10 +170,10 @@
 		"Buffers:      %8lu kB\n"
 		"Cached:       %8lu kB\n"
 		"SwapCached:   %8lu kB\n"
-		"Active:       %8u kB\n"
-		"Inact_dirty:  %8u kB\n"
-		"Inact_clean:  %8u kB\n"
-		"Inact_target: %8u kB\n"
+		"Active:       %8lu kB\n"
+		"Inact_dirty:  %8lu kB\n"
+		"Inact_clean:  %8lu kB\n"
+		"Inact_target: %8lu kB\n"
 		"HighTotal:    %8lu kB\n"
 		"HighFree:     %8lu kB\n"
 		"LowTotal:     %8lu kB\n"


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

             reply	other threads:[~2001-09-05 19:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-05 19:38 Ben LaHaise [this message]
2001-09-05 19:45 ` Andrea Arcangeli
2001-09-05 20:00   ` Ben LaHaise
2001-09-05 20:08     ` Andrea Arcangeli

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=Pine.LNX.4.33.0109051538400.16684-100000@toomuch.toronto.redhat.com \
    --to=bcrl@redhat.com \
    --cc=linux-mm@kvack.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