* Re: [PATCH] Display 0 in meminfo for Committed_AS when value underflows [not found] <1240848620-16751-1-git-send-email-ebmunson@us.ibm.com> @ 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; 4+ 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Display 0 in meminfo for Committed_AS when value underflows 2009-04-27 16:15 ` [PATCH] Display 0 in meminfo for Committed_AS when value underflows Dave Hansen @ 2009-04-27 16:15 ` Christoph Lameter 2009-04-27 19:52 ` Andrew Morton 1 sibling, 0 replies; 4+ 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Display 0 in meminfo for Committed_AS when value underflows 2009-04-27 16:15 ` [PATCH] Display 0 in meminfo for Committed_AS when value underflows 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; 4+ 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? ^ permalink raw reply [flat|nested] 4+ 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; 4+ 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 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-27 20:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <1240848620-16751-1-git-send-email-ebmunson@us.ibm.com>
2009-04-27 16:15 ` [PATCH] Display 0 in meminfo for Committed_AS when value underflows 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
Powered by JetHome