lkml.org 
[lkml]   [2009]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [mmotm][BUGFIX][PATCH] memcg: fix softlimit css refcnt handling(yet another one)
On Mon, 7 Sep 2009 08:04:03 +0900
Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp> wrote:

> On Fri, 4 Sep 2009 19:07:26 +0900
> Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp> wrote:
>
> > On Fri, 4 Sep 2009 16:37:58 +0900
> > KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> wrote:
> >
> > > On Fri, 4 Sep 2009 15:40:50 +0900
> > > Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp> wrote:
> > > > > Ah, one more question. What memory.usage_in_bytes shows in that case ?
> > > > > If not zero, charge/uncharge coalescing is guilty.
> > > > >
> > > > usage_in_bytes is 0.
> > > > I've confirmed by crash command that the mem_cgroup has extra ref counts.
> > > >
> > > > I'll dig more..
> > > >
> > > BTW, do you use softlimit ? I found this but...Hmm
> > >
> > No.
> > I'm sorry I can't access my machine, so can't test this.
> >
> >
> > But I think this patch itself is needed and looks good.
> >
> I've found the cause of the issue.
>
> Andrew, could you add this one after KAMEZAWA-san's
> memory-controller-soft-limit-reclaim-on-contention-v9-fix-softlimit-css-refcnt-handling.patch ?
>
> ===
> From: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
>
> refcount of the "victim" should be decremented before exiting the loop.
>
> Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Nice!

Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

> ---
> mm/memcontrol.c | 8 ++++++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index ac51294..011aba6 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1133,8 +1133,10 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
> * anything, it might because there are
> * no reclaimable pages under this hierarchy
> */
> - if (!check_soft || !total)
> + if (!check_soft || !total) {
> + css_put(&victim->css);
> break;
> + }
> /*
> * We want to do more targetted reclaim.
> * excess >> 2 is not to excessive so as to
> @@ -1142,8 +1144,10 @@ static int mem_cgroup_hierarchical_reclaim(struct mem_cgroup *root_mem,
> * coming back to reclaim from this cgroup
> */
> if (total >= (excess >> 2) ||
> - (loop > MEM_CGROUP_MAX_RECLAIM_LOOPS))
> + (loop > MEM_CGROUP_MAX_RECLAIM_LOOPS)) {
> + css_put(&victim->css);
> break;
> + }
> }
> }
> if (!mem_cgroup_local_usage(&victim->stat)) {
>



\
 
 \ /
  Last update: 2009-09-07 02:55    [W:4.455 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site