Re: [PATCH -mm 1/5] memcg: replace res_counter

Paul Menage
2008-10-21T02:15:39Z

On Mon, Oct 20, 2008 at 6:49 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> wrote:
>
> res_counter's operation is very short.
> take a lock => add and compare. => unlock.
>
> So, I wonder there is not enough runway to do prefetch.

Sorry, let me be clearer. I'm assuming that since a write operation on
the base counter will generally be accompanied by a write operation on
the aggregate counter, that one of the following is true:

- neither cache line is in a M or E state in our cache. So the
prefetchw on the aggregate counter proceeds in parallel to the stall
on fetching the base counter, and there's no additional delay to
access the aggregate counter.

- both cache lines are in a M or E state in our cache, so there are no
misses on either counter.

Paul