* [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
* Re: [PATCH] /proc/meminfo (fwd)
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
0 siblings, 1 reply; 4+ messages in thread
From: Andrea Arcangeli @ 2001-09-05 19:45 UTC (permalink / raw)
To: Ben LaHaise; +Cc: linux-mm, Alan Cox, Arjan van de Ven
On Wed, Sep 05, 2001 at 03:38:57PM -0400, Ben LaHaise wrote:
> 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:.
I fixed such bug ages ago:
ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.10pre4aa1/00_meminfo-wraparound-2
Andrea
--
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
* Re: [PATCH] /proc/meminfo (fwd)
2001-09-05 19:45 ` Andrea Arcangeli
@ 2001-09-05 20:00 ` Ben LaHaise
2001-09-05 20:08 ` Andrea Arcangeli
0 siblings, 1 reply; 4+ messages in thread
From: Ben LaHaise @ 2001-09-05 20:00 UTC (permalink / raw)
To: Andrea Arcangeli; +Cc: linux-mm, Alan Cox, Arjan van de Ven
On Wed, 5 Sep 2001, Andrea Arcangeli wrote:
> I fixed such bug ages ago:
>
> ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.10pre4aa1/00_meminfo-wraparound-2
Is it scheduled for merging? Arjan mentioned that it may have broken some
apps (like top) and have been pulled earlier. My vote is for letting them
break and get fixed on highmem machines, but other people might have
different opinions.
-ben
--
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
* Re: [PATCH] /proc/meminfo (fwd)
2001-09-05 20:00 ` Ben LaHaise
@ 2001-09-05 20:08 ` Andrea Arcangeli
0 siblings, 0 replies; 4+ messages in thread
From: Andrea Arcangeli @ 2001-09-05 20:08 UTC (permalink / raw)
To: Ben LaHaise; +Cc: linux-mm, Alan Cox, Arjan van de Ven
On Wed, Sep 05, 2001 at 04:00:28PM -0400, Ben LaHaise wrote:
> On Wed, 5 Sep 2001, Andrea Arcangeli wrote:
>
> > I fixed such bug ages ago:
> >
> > ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.10pre4aa1/00_meminfo-wraparound-2
>
> Is it scheduled for merging? Arjan mentioned that it may have broken some
I don't remeber if I've sent it to Linus or not yet but yes.
> apps (like top) and have been pulled earlier. My vote is for letting them
never got a bugreport about it so I guess top should be ok but if top
breaks it is the one that has to be fixed so...
> break and get fixed on highmem machines, but other people might have
> different opinions.
I certainly agree with you.
Andrea
--
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