Messages in this thread | | | Date | Thu, 15 Nov 2012 10:51:03 +0100 | From | Michal Hocko <> | Subject | Re: [RFC 2/5] memcg: rework mem_cgroup_iter to use cgroup iterators |
| |
On Wed 14-11-12 10:52:45, Tejun Heo wrote: > Hello, Michal. > > On Wed, Nov 14, 2012 at 09:51:29AM +0100, Michal Hocko wrote: > > > reclaim(root); > > > for_each_descendent_pre() > > > reclaim(descendant); > > > > We cannot do for_each_descendent_pre here because we do not iterate > > through the whole hierarchy all the time. Check shrink_zone. > > I'm a bit confused. Why would that make any difference? Shouldn't it > be just able to test the condition and continue?
Ohh, I misunderstood your proposal. So what you are suggesting is to put all the logic we have in mem_cgroup_iter inside what you call reclaim here + mem_cgroup_iter_break inside the loop, right?
I do not see how this would help us much. mem_cgroup_iter is not the nicest piece of code but it handles quite a complex requirements that we have currently (css reference count, multiple reclaimers racing). So I would rather keep it this way. Further simplifications are welcome of course.
Is there any reason why you are not happy about direct using of cgroup_next_descendant_pre? -- Michal Hocko SUSE Labs
| |