lkml.org 
[lkml]   [2010]   [Jun]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH] memcg remove css_get/put per pages v2
On Fri, 11 Jun 2010 13:52:02 +0900, KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> On Fri, 11 Jun 2010 13:37:44 +0900
> Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
>
> > > @@ -2432,15 +2463,18 @@ mem_cgroup_uncharge_swapcache(struct pag
> > > if (!swapout) /* this was a swap cache but the swap is unused ! */
> > > ctype = MEM_CGROUP_CHARGE_TYPE_DROP;
> > >
> > > - memcg = __mem_cgroup_uncharge_common(page, ctype);
> > > + memcg = try_get_mem_cgroup_from_page(page);
> > > + if (!memcg)
> > > + return;
> > > +
> > > + __mem_cgroup_uncharge_common(page, ctype);
> > >
> > > /* record memcg information */
> > > - if (do_swap_account && swapout && memcg) {
> > > + if (do_swap_account && swapout) {
> > > swap_cgroup_record(ent, css_id(&memcg->css));
> > > mem_cgroup_get(memcg);
> > > }
> > > - if (swapout && memcg)
> > > - css_put(&memcg->css);
> > > + css_put(&memcg->css);
> > > }
> > > #endif
> > >
> > hmm, this change seems to cause a problem.
> > I can see under flow of mem->memsw and "swap" field in memory.stat.
> >
> > I think doing swap_cgroup_record() against mem_cgroup which is not returned
> > by __mem_cgroup_uncharge_common() is a bad behavior.
> >
> > How about doing like this ? We can safely access mem_cgroup while it has
> > memory.usage, iow, before we call res_counter_uncharge().
> > After this change, it seems to work well.
> >
>
> Thank you!. seems to work. I'll merge your change.
> Can I add your Signed-off-by ?
>
Sure.

Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>


\
 
 \ /
  Last update: 2010-06-11 07:07    [W:0.082 / U:0.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site