linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] /proc/meminfo (fwd)
@ 2001-09-05 19:38 Ben LaHaise
  2001-09-05 19:45 ` Andrea Arcangeli
  0 siblings, 1 reply; 4+ messages in thread
From: Ben LaHaise @ 2001-09-05 19:38 UTC (permalink / raw)
  To: linux-mm

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/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-09-05 20:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-05 19:38 [PATCH] /proc/meminfo (fwd) Ben LaHaise
2001-09-05 19:45 ` Andrea Arcangeli
2001-09-05 20:00   ` Ben LaHaise
2001-09-05 20:08     ` Andrea Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox