From: Michal Hocko Date: Sat, 23 Feb 2013 00:35:41 +0000 (-0800) Subject: memcg: cleanup mem_cgroup_init comment X-Git-Tag: v3.9-rc1~99^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1081312f95be1a0fc093556d789e482d3ab0f5b0;p=profile%2Fcommon%2Fkernel-common.git memcg: cleanup mem_cgroup_init comment We should encourage all memcg controller initialization independent on a specific mem_cgroup to be done here rather than exploit css_alloc callback and assume that nothing happens before root cgroup is created. Signed-off-by: Michal Hocko Acked-by: Johannes Weiner Cc: Tejun Heo Cc: KAMEZAWA Hiroyuki Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 604eddc..d4f0a83 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6830,10 +6830,12 @@ static void __init enable_swap_cgroup(void) #endif /* - * The rest of init is performed during ->css_alloc() for root css which - * happens before initcalls. hotcpu_notifier() can't be done together as - * it would introduce circular locking by adding cgroup_lock -> cpu hotplug - * dependency. Do it from a subsys_initcall(). + * subsys_initcall() for memory controller. + * + * Some parts like hotcpu_notifier() have to be initialized from this context + * because of lock dependencies (cgroup_lock -> cpu hotplug) but basically + * everything that doesn't depend on a specific mem_cgroup structure should + * be initialized from here. */ static int __init mem_cgroup_init(void) {