On Sat 27-07-19 07:47:58, Miles Chen wrote: > On Fri, 2019-07-26 at 14:55 +0200, Michal Hocko wrote: [...] > > > I am sorry, I didn't get to comment an earlier version but I am > > > wondering whether it makes more sense to do and explicit invalidation. > > > > > I think we should keep the original v2 version, the reason is the > !use_hierarchy does not imply we can reach root_mem_cgroup: > > cd /sys/fs/cgroup/memory/0 > mkdir 1 > cd /sys/fs/cgroup/memory/0/1 > echo 1 > memory.use_hierarchy // only 1 and its children has > use_hierarchy set > mkdir 2 > > rmdir 2 // parent_mem_cgroup(2) goes up to 1 You are right I have missed this case. I am not sure anybody is using layout like that but your fix is more robust and catches that case as well. Acked-by: Michal Hocko <mhocko@xxxxxxxx> -- Michal Hocko SUSE Labs