* [PATCH] Display 0 in meminfo for Committed_AS when value underflows
@ 2009-04-27 16:10 Eric B Munson
2009-04-27 16:15 ` Dave Hansen
0 siblings, 1 reply; 5+ messages in thread
From: Eric B Munson @ 2009-04-27 16:10 UTC (permalink / raw)
To: akpm; +Cc: kosaki.motohiro, linux-mm, linux-kernel, mel, cl, dave,
Eric B Munson
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.
Reported-by: Dave Hansen <dave@linux.vnet.ibm.com>
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
fs/proc/meminfo.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 74ea974..facb9fb 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -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;
--
1.6.1.2
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] Display 0 in meminfo for Committed_AS when value underflows
2009-04-27 16:10 [PATCH] Display 0 in meminfo for Committed_AS when value underflows Eric B Munson
@ 2009-04-27 16:15 ` Dave Hansen
2009-04-27 16:15 ` Christoph Lameter
2009-04-27 19:52 ` Andrew Morton
0 siblings, 2 replies; 5+ messages in thread
From: Dave Hansen @ 2009-04-27 16:15 UTC (permalink / raw)
To: Eric B Munson; +Cc: akpm, kosaki.motohiro, linux-mm, linux-kernel, mel, cl
On Mon, 2009-04-27 at 17:10 +0100, Eric B Munson wrote:
> 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.
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 <dave@linux.vnet.ibm.com>
> From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
> ---
> fs/proc/meminfo.c | 4 +++-
> 1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
> index 74ea974..facb9fb 100644
> --- a/fs/proc/meminfo.c
> +++ b/fs/proc/meminfo.c
> @@ -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;
>
-- Dave
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Display 0 in meminfo for Committed_AS when value underflows
2009-04-27 16:15 ` Dave Hansen
@ 2009-04-27 16:15 ` Christoph Lameter
2009-04-27 19:52 ` Andrew Morton
1 sibling, 0 replies; 5+ messages in thread
From: Christoph Lameter @ 2009-04-27 16:15 UTC (permalink / raw)
To: Dave Hansen
Cc: Eric B Munson, akpm, kosaki.motohiro, linux-mm, linux-kernel, mel
On Mon, 27 Apr 2009, Dave Hansen wrote:
> 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 majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Display 0 in meminfo for Committed_AS when value underflows
2009-04-27 16:15 ` Dave Hansen
2009-04-27 16:15 ` Christoph Lameter
@ 2009-04-27 19:52 ` Andrew Morton
2009-04-27 20:06 ` Dave Hansen
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2009-04-27 19:52 UTC (permalink / raw)
To: Dave Hansen; +Cc: ebmunson, kosaki.motohiro, linux-mm, linux-kernel, mel, cl
On Mon, 27 Apr 2009 09:15:14 -0700
Dave Hansen <dave@linux.vnet.ibm.com> wrote:
> On Mon, 2009-04-27 at 17:10 +0100, Eric B Munson wrote:
> > 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.
>
> 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 <dave@linux.vnet.ibm.com>
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 majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Display 0 in meminfo for Committed_AS when value underflows
2009-04-27 19:52 ` Andrew Morton
@ 2009-04-27 20:06 ` Dave Hansen
0 siblings, 0 replies; 5+ messages in thread
From: Dave Hansen @ 2009-04-27 20:06 UTC (permalink / raw)
To: Andrew Morton; +Cc: ebmunson, kosaki.motohiro, linux-mm, linux-kernel, mel, cl
On Mon, 2009-04-27 at 12:52 -0700, Andrew Morton wrote:
> On Mon, 27 Apr 2009 09:15:14 -0700
> Dave Hansen <dave@linux.vnet.ibm.com> wrote:
> > On Mon, 2009-04-27 at 17:10 +0100, Eric B Munson wrote:
> > > 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.
> >
> > 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 <dave@linux.vnet.ibm.com>
>
> 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.
Reported-by: Dave Hansen <dave@linux.vnet.ibm.com>
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
fs/proc/meminfo.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index 74ea974..facb9fb 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -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;
--
1.6.1.2
-- Dave
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-04-27 20:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-27 16:10 [PATCH] Display 0 in meminfo for Committed_AS when value underflows Eric B Munson
2009-04-27 16:15 ` Dave Hansen
2009-04-27 16:15 ` Christoph Lameter
2009-04-27 19:52 ` Andrew Morton
2009-04-27 20:06 ` Dave Hansen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).