Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755573AbaDVKeZ (ORCPT ); Tue, 22 Apr 2014 06:34:25 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35861 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755011AbaDVKeX (ORCPT ); Tue, 22 Apr 2014 06:34:23 -0400 Date: Tue, 22 Apr 2014 12:34:21 +0200 From: Michal Hocko To: Jianyu Zhan Cc: Johannes Weiner , Balbir Singh , kamezawa.hiroyu@jp.fujitsu.com, Cgroups , "linux-mm@kvack.org" , LKML Subject: Re: [PATCH 1/2] mm/memcontrol.c: remove meaningless while loop in mem_cgroup_iter() Message-ID: <20140422103420.GI29311@dhcp22.suse.cz> References: <1397861935-31595-1-git-send-email-nasa4836@gmail.com> <20140422094759.GC29311@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.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 22-04-14 18:17:09, Jianyu Zhan wrote: > On Tue, Apr 22, 2014 at 5:47 PM, Michal Hocko wrote: > > What about > > 3. last_visited == last_node in the tree > > > > __mem_cgroup_iter_next returns NULL and the iterator would return > > without visiting anything. > > Hi, Michal, > > yep, if 3 last_visited == last_node, then this means we have done a round-trip, > thus __mem_cgroup_iter_next returns NULL, in turn mem_cgroup_iter() return NULL. Sorry, I should have been more specific that I was talking about mem_cgroup_reclaim_cookie path where the iteration for this particular zone and priority ended at the last node without finishing the full roundtrip last time. This new iteration (prev==NULL) wants to continue and it should start a new roundtrip. Makes sense? -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/