Re: [PATCH 00/14] Zoned VM counters V5

Martin Bligh
2006-06-21T17:21:58Z

Christoph Lameter wrote:
> On Wed, 21 Jun 2006, Martin Bligh wrote:
>
>
>>>Yes later patches also use the counters for other things. Please check out
>>>the patch that uses these for numa counters etc.
>>
>>OK, but looked like the original implementation was sort of tied to
>>zones / the VM, at least in terminology, and code placement. I'll look
>>at it again ...
>
>
> Yes it is. This one is useful only for zone related information.
>
>
>>>Also smaller counters help keep the pcp structure in one cacheline and
>>>reduces the cache footprint.
>>
>>Sure, but for a normal sized system, the smaller the per-cpu portion,
>>the more atomic ops you'll end up doing, surely?
>
>
> So we now do two atomic ops for every 32 increments (threshold). If we
> increment the threshhold then we reduce the atomic overhead but this also
> influences the inaccurary of the global and per zone counter because
> there is the potential of more counter update deferrals. Keeping the
> threshold low makes the global and per zone counter more up to date.
> I think 32 is a good compromise.

Ah, makes sense ... so the intent is get an an approximation. If you
want accurate numbers, you still need to walk the per-cpu counters ...
is that too slow for where you're reading it? didn't seem like a
fastpath to me, given that balance_dirty_pages was already ratelimited?
I guess it's still better than what we're doing now though ;-)

M.