Display 0 in meminfo for Committed_AS when value underflows
Subsystems (3)
PATCH 1/1 Display 0 in meminfo for Committed_AS when value underflows
Andrew,
Please merge the following patch.
Splitting this patch from the chunk that addresses the cause of the underflow because the solution still requires some discussion.
Dave Hansen reported that under certain cirumstances the Committed_AS value can underflow which causes extremely large numbers to be displayed in meminfo. This patch adds an underflow check to meminfo_proc_show() for the Committed_AS value. Most fields in /proc/meminfo already have an underflow check, this brings Committed_AS into line.
From: KOSAKI Motohiro <[email protected]>
--- fs/proc/meminfo.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fs/proc/meminfo.c +3 -1
@@ -22,7 +22,7 @@ void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)static int meminfo_proc_show (struct seq_file *m,void *v) {struct sysinfo i; -unsigned long committed; +long committed;unsigned long allowed;struct vmalloc_info vmi;long cached;
@@ -36,6 +36,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)si_meminfo (&i);si_swapinfo (&i); committed =atomic_long_read (&vm_committed_space); +if (committed <0 ) + committed =0 ; allowed = ((totalram_pages -hugetlb_total_pages ()) * sysctl_overcommit_ratio /100 ) + total_swap_pages;
Signature · 7 lines
1.6.1.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 8 lines · Eric B Munson
Splitting this patch from the chunk that addresses the cause of the underflow because the solution still requires some discussion.
Dave Hansen reported that under certain cirumstances the
Committed_ASvalue can underflow which causes extremely large numbers to be displayed in meminfo. This patch adds an underflow check tomeminfo_proc_show()for theCommitted_ASvalue. Most fields in/proc/meminfoalready have an underflow check, this bringsCommitted_ASinto line.
Yeah, this is the right fix for now until we can iron out the base issues. Eric, I think this may also be a candidate for -stable.
Quoted 21 lines
From: KOSAKI Motohiro <[email protected]>
Signed-off-by KOSAKI Motohiro <[email protected]>Signed-off-by Eric B Munson <[email protected]>--- fs/proc/meminfo.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)fs/proc/meminfo.c +1
-1@@ -22,7 +22,7 @@ void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)static int meminfo_proc_show (struct seq_file *m,void *v) {struct sysinfo i; -unsigned long committed; +long committed;unsigned long allowed;struct vmalloc_info vmi;long cached;
fs/proc/meminfo.c static int meminfo_proc_show(struct seq_file *m, void *v) · line 43
Quoted 8 lines
fs/proc/meminfo.c +2
-0@@ -36,6 +36,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)si_meminfo (&i);si_swapinfo (&i); committed =atomic_long_read (&vm_committed_space); +if (committed <0 ) + committed =0 ; allowed = ((totalram_pages -hugetlb_total_pages ()) * sysctl_overcommit_ratio /100 ) + total_swap_pages;
-- Dave
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 2 lines · Dave Hansen
Yeah, this is the right fix for now until we can iron out the base issues. Eric, I think this may also be a candidate for -stable.
Is there any way you could use a ZVC there? Those already have the underflow prevention logic. See include/linux/vmstat.h and mm/vmstat.c
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerQuoted 10 lines · On Mon, 27 Apr 2009 09:15:14 -0700 Dave Hansen <[email protected]> wrote:
Quoted 8 lines · Eric B Munson
Splitting this patch from the chunk that addresses the cause of the underflow because the solution still requires some discussion.
Dave Hansen reported that under certain cirumstances the
Committed_ASvalue can underflow which causes extremely large numbers to be displayed in meminfo. This patch adds an underflow check tomeminfo_proc_show()for theCommitted_ASvalue. Most fields in/proc/meminfoalready have an underflow check, this bringsCommitted_ASinto line.
Quoted 4 lines
Yeah, this is the right fix for now until we can iron out the base issues. Eric, I think this may also be a candidate for -stable.
Signed-off-by Dave Hansen <[email protected]>
I cannot find Eric's original patch anywhere. Did some demented MTA munch it?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 12 lines · Andrew Morton
Quoted 10 lines · On Mon, 27 Apr 2009 09:15:14 -0700 Dave Hansen <[email protected]> wrote:
Quoted 8 lines · Eric B Munson
Splitting this patch from the chunk that addresses the cause of the underflow because the solution still requires some discussion.
Dave Hansen reported that under certain cirumstances the
Committed_ASvalue can underflow which causes extremely large numbers to be displayed in meminfo. This patch adds an underflow check tomeminfo_proc_show()for theCommitted_ASvalue. Most fields in/proc/meminfoalready have an underflow check, this bringsCommitted_ASinto line.
Quoted 6 lines
Quoted 4 lines
Yeah, this is the right fix for now until we can iron out the base issues. Eric, I think this may also be a candidate for -stable.
Signed-off-by Dave Hansen <[email protected]>I cannot find Eric's original patch anywhere. Did some demented MTA munch it?
Here's the version that I got. My guess would be that your copy is sitting in some IBM mail server's queue right now. It might show up in a couple of days. :)
---
Andrew,
Please merge the following patch.
Splitting this patch from the chunk that addresses the cause of the underflow because the solution still requires some discussion.
Dave Hansen reported that under certain cirumstances the Committed_AS value can underflow which causes extremely large numbers to be displayed in meminfo. This patch adds an underflow check to meminfo_proc_show() for the Committed_AS value. Most fields in /proc/meminfo already have an underflow check, this brings Committed_AS into line.
From: KOSAKI Motohiro <[email protected]>
--- fs/proc/meminfo.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
fs/proc/meminfo.c +3 -1
@@ -22,7 +22,7 @@ void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)static int meminfo_proc_show (struct seq_file *m,void *v) {struct sysinfo i; -unsigned long committed; +long committed;unsigned long allowed;struct vmalloc_info vmi;long cached;
@@ -36,6 +36,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)si_meminfo (&i);si_swapinfo (&i); committed =atomic_long_read (&vm_committed_space); +if (committed <0 ) + committed =0 ; allowed = ((totalram_pages -hugetlb_total_pages ()) * sysctl_overcommit_ratio /100 ) + total_swap_pages;
Signature · 10 lines
1.6.1.2 -- Dave -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>