Re: [PATCH 2/6 v4] memcg: simplify move_account() check

From: KAMEZAWA Hiroyuki
Date: Tue Feb 14 2012 - 03:46:10 EST


On Mon, 13 Feb 2012 23:21:34 -0800
Greg Thelen <gthelen@xxxxxxxxxx> wrote:

> On Mon, Feb 13, 2012 at 7:07 PM, KAMEZAWA Hiroyuki
> <kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
> > From 9cdb3b63dc8d08cc2220c54c80438c13433a0d12 Mon Sep 17 00:00:00 2001
> > From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
> > Date: Thu, 2 Feb 2012 10:02:39 +0900
> > Subject: [PATCH 2/6] memcg: simplify move_account() check.
> >
> > In memcg, for avoiding take-lock-irq-off at accessing page_cgroup,
> > a logic, flag + rcu_read_lock(), is used. This works as following
> >
> > Â Â CPU-A Â Â Â Â Â Â Â Â Â Â CPU-B
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â rcu_read_lock()
> > Â Âset flag
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â if(flag is set)
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â take heavy lock
> > Â Â Â Â Â Â Â Â Â Â Â Â Â Â do job.
> > Â Âsynchronize_rcu() Â Â Â Ârcu_read_unlock()
>
> I assume that CPU-A will take heavy lock after synchronize_rcu() when
> updating variables read by CPU-B.
>
Ah, yes. I should wrote that.

> > Âmemcontrol.c | Â 65 ++++++++++++++++++++++-------------------------------------
> > Â1 file changed, 25 insertions(+), 40 deletions(-)
> >
> > Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>
>
> Acked-by: Greg Thelen <gthelen@xxxxxxxxxx>
>

Thank you!.

-Kame

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/