From a34a9d57f287071e2d0d7223d4c23d11850d3aef Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 20 Dec 2012 15:05:40 -0800 Subject: [PATCH] --- yaml --- r: 347884 b: refs/heads/master c: 154b454edaf6d94a69016db6c342c57fa935bbe9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/memcontrol.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 957115e8b89e..066df1d25017 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 495e9d84607cda966ba6d223d5eb9df0070cd21a +refs/heads/master: 154b454edaf6d94a69016db6c342c57fa935bbe9 diff --git a/trunk/mm/memcontrol.c b/trunk/mm/memcontrol.c index f3009b4bae51..09255ec8159c 100644 --- a/trunk/mm/memcontrol.c +++ b/trunk/mm/memcontrol.c @@ -6090,7 +6090,6 @@ mem_cgroup_css_alloc(struct cgroup *cont) &per_cpu(memcg_stock, cpu); INIT_WORK(&stock->work, drain_local_stock); } - hotcpu_notifier(memcg_cpu_hotplug_callback, 0); } else { parent = mem_cgroup_from_cont(cont->parent); memcg->use_hierarchy = parent->use_hierarchy; @@ -6756,6 +6755,19 @@ struct cgroup_subsys mem_cgroup_subsys = { .use_id = 1, }; +/* + * 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(). + */ +static int __init mem_cgroup_init(void) +{ + hotcpu_notifier(memcg_cpu_hotplug_callback, 0); + return 0; +} +subsys_initcall(mem_cgroup_init); + #ifdef CONFIG_MEMCG_SWAP static int __init enable_swap_account(char *s) {