Re: [PATCH 03/19] fs: Convert nr_inodes and nr_unused to per-cpu counters

Dave Chinner
2010-10-17T01:09:49Z

On Sat, Oct 16, 2010 at 07:26:48PM +0200, Peter Zijlstra wrote:
> On Sat, 2010-10-16 at 12:27 +0200, Eric Dumazet wrote:
> >
> > In cases you mention, you want a precise count (aka
> > percpu_counter_sum_positive()), not the approximate one (aka
> > percpu_counter_read_positive()).
> >
> > The only difference is then the possible/online cpu loop difference.
> >
> In either case, SGI is screwed, doing millions of for_each_*_cpu() loops
> per second isn't going to work for them.
>
> fwiw, for_each_*_cpu() takes longer than a single jiffy tick on those
> machines.

Yes, agreed. I'm not sure we need exact summation for these counters,
but I haven't wanted to bring inaccuracies into the code at this
point in time. I need to investigate the effect of using the
approximate summation values in all the cases they are used.

I don't see that there will be a problem doing this, but it's not
something that needs to be cared about right now. After we get to
the store-free path walks in place, we can revisit all these side
issues more fully.

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com