From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754770Ab2LLSeu (ORCPT ); Wed, 12 Dec 2012 13:34:50 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:43667 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754610Ab2LLSet (ORCPT ); Wed, 12 Dec 2012 13:34:49 -0500 Date: Wed, 12 Dec 2012 19:34:46 +0100 From: Michal Hocko To: Ying Han Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, KAMEZAWA Hiroyuki , Johannes Weiner , Tejun Heo , Glauber Costa , Li Zefan Subject: Re: [patch v2 3/6] memcg: rework mem_cgroup_iter to use cgroup iterators Message-ID: <20121212183446.GB10374@dhcp22.suse.cz> References: <1353955671-14385-1-git-send-email-mhocko@suse.cz> <1353955671-14385-4-git-send-email-mhocko@suse.cz> <20121211155432.GC1612@dhcp22.suse.cz> <20121212090652.GB32081@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 12-12-12 10:09:43, Ying Han wrote: [...] > But If i look at the callers of mem_cgroup_iter(), they all look like > the following: > > memcg = mem_cgroup_iter(root, NULL, &reclaim); > do { > > // do something > > memcg = mem_cgroup_iter(root, memcg, &reclaim); > } while (memcg); > > So we get out of the loop when memcg returns as NULL, where the > last_visited is cached as NULL as well thus no css_get(). That is what > I meant by "each reclaim thread closes the loop". OK > If that is true, the current implementation of mem_cgroup_iter_break() > changes that. I do not understand this though. Why should we touch the zone-iter there? Just consider, if we did that then all the parallel targeted reclaimers (! global case) would hammer the first node (root) as they wouldn't continue where the last one finished. [...] Thanks! -- Michal Hocko SUSE Labs