Re: meminfo Committed_AS underflows

From: Andrew Morton
Date: Mon Apr 27 2009 - 16:32:20 EST


On Wed, 15 Apr 2009 14:17:13 +0530
Balbir Singh <balbir@xxxxxxxxxxxxxxxxxx> wrote:

> * KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> [2009-04-15 13:10:06]:
>
> > > * KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx> [2009-04-15 11:04:59]:
> > >
> > > > committed = atomic_long_read(&vm_committed_space);
> > > > + if (committed < 0)
> > > > + committed = 0;
> > >

Is there a reason why we can't use a boring old percpu_counter for
vm_committed_space? That way the meminfo code can just use
percpu_counter_read_positive().

Or perhaps just percpu_counter_read(). The percpu_counter code does a
better job of handling large cpu counts than the
mysteriously-duplicative open-coded stuff we have there.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/