Re: another approach to rss : sloppy rss

Nick Piggin
2004-11-20T01:24:17Z

Robin Holt wrote:
> On Fri, Nov 19, 2004 at 11:21:38AM -0800, Christoph Lameter wrote:

>>I think the sloppy rss approach is the right way to go.
>
>
> Is this really that much of a problem? Why not leave rss as an _ACCURATE_
> count of pages. That way stuff like limits based upon rss and accounting
> of memory usage are accurate.
>

I think I agree. (But Christoph is right that in practice probably nobody
or very few will ever notice).

> Have we tried splitting into seperate cache lines? How about grouped counters
> for every 16 cpus instead of a per-cpu counter as proposed by someone else
> earlier.
>

Well, you still need to put those counters on seperate cachelines, so you
still need to pad them out quite a lot. Then as they are shared, you _still_
need to make them atomic, and they'll still be bouncing around too.

Linus' idea of a per-thread 'pages_in - pages_out' counter may prove to be
just the right solution though.

Nick