On Fri 21-03-14 11:23:51, Luís Henriques wrote: > On Thu, Mar 20, 2014 at 09:40:20PM -0700, Hugh Dickins wrote: [...] > > But the version for 3.10.34 (or perhaps now 3.10.35) is this below. > > Yes, more differences, and the old mem_cgroup_reparent_charges line > > is intentionally left in for 3.10 whereas it was removed for 3.12+: > > that's because the css/cgroup iterator changed in between, it used > > not to supply the root of the subtree, but nowadays it does. [...] > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -6326,9 +6326,23 @@ static void mem_cgroup_invalidate_reclai > > static void mem_cgroup_css_offline(struct cgroup *cont) > > { > > struct mem_cgroup *memcg = mem_cgroup_from_cont(cont); > > + struct cgroup *iter; > > > > mem_cgroup_invalidate_reclaim_iterators(memcg); > > + > > + /* > > + * This requires that offlining is serialized. Right now that is > > + * guaranteed because css_killed_work_fn() holds the cgroup_mutex. > > + */ > > + rcu_read_lock(); > > + cgroup_for_each_descendant_post(iter, cont) { > > + rcu_read_unlock(); > > + mem_cgroup_reparent_charges(mem_cgroup_from_cont(iter)); > > + rcu_read_lock(); > > + } > > + rcu_read_unlock(); > > mem_cgroup_reparent_charges(memcg); > > Is this correct? ^^^ > > I may be missing something, but I believe this call to > mem_cgroup_reparent_charges() should be dropped (as in the original commit > and in your 3.13 backport). Nope. Because the cgroup iterators in 3.10 do not visit the root of the hierarchy and so it has to be visited explicitly. Hugh has mentioned that explicitly above (see bd8815a6d802 cgroup: make css_for_each_descendant() and friends include the origin css in the iteration). -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html