[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110513065459.GA18610@cmpxchg.org>
Date: Fri, 13 May 2011 08:54:59 +0200
From: Johannes Weiner <hannes@...xchg.org>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Cc: Daisuke Nishimura <nishimura@....nes.nec.co.jp>,
Balbir Singh <balbir@...ux.vnet.ibm.com>,
Ying Han <yinghan@...gle.com>, Michal Hocko <mhocko@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...hat.com>,
Minchan Kim <minchan.kim@...il.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Mel Gorman <mgorman@...e.de>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [rfc patch 3/6] mm: memcg-aware global reclaim
On Fri, May 13, 2011 at 09:40:50AM +0900, KAMEZAWA Hiroyuki wrote:
> > @@ -1954,6 +1952,19 @@ restart:
> > goto restart;
> >
> > throttle_vm_writeout(sc->gfp_mask);
> > +}
> > +
> > +static void shrink_zone(int priority, struct zone *zone,
> > + struct scan_control *sc)
> > +{
> > + struct mem_cgroup *root = sc->memcg;
> > + struct mem_cgroup *mem = NULL;
> > +
> > + do {
> > + mem_cgroup_hierarchy_walk(root, &mem);
> > + sc->current_memcg = mem;
> > + do_shrink_zone(priority, zone, sc);
>
> If I don't miss something, css_put() against mem->css will be required somewhere.
That's a bit of a hack. mem_cgroup_hierarchy_walk() always does
css_put() on *mem before advancing to the next child.
At the last iteration, it returns mem == root. Since the caller must
have a reference on root to begin with, it does not css_get() root.
So when mem == root, there are no outstanding references from the walk
anymore.
This only works since it always does the full hierarchy walk, so it's
going away anyway when the hierarchy walk becomes intermittent.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists