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

Paul Menage
2008-10-21T06:30:38Z

On Mon, Oct 20, 2008 at 8:03 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@jp.fujitsu.com> wrote:
> I think we can't do without performance hit. Considering parent<->child counter,
> parent is busier than child if usage is propergated from child to parent. So,
> prefetch will be just a smal help.

You're right, this argument isn't valid in the case of a parent-child counter.

> I don't like *unsigned long long* just because we have to do following
> =
> res->usage < *some number*
> =
> or
> =
> val = res->usage.
> =
> always under lock because usage is unsigned long long.

That's true. But isn't the first case going to be accompanied
generally by an increment, for which you'd need to do an atomic
operation anyway? and the second case is most likely for a read from
userspace which isn't on the fast path.

Paul