On Wed 12-12-12 19:34:46, Michal Hocko wrote: > 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 Bahh, parallel is only confusing here. Say first child triggers a hard limit reclaim then root of the hierarchy will be reclaimed first. iter_break would reset iter->last_visited. Then B triggers the same reclaim but we will start again from root rather than the first child because it doesn't know where the other one stopped. Hope this clarifies it and sorry for all the confusion. > reclaimers (! global case) would hammer the first node (root) as they > wouldn't continue where the last one finished. > > [...] > > Thanks! -- Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>