diff options
| -rw-r--r-- | mm/memcontrol.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f3009b4bae51..09255ec8159c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
| @@ -6090,7 +6090,6 @@ mem_cgroup_css_alloc(struct cgroup *cont) | |||
| 6090 | &per_cpu(memcg_stock, cpu); | 6090 | &per_cpu(memcg_stock, cpu); |
| 6091 | INIT_WORK(&stock->work, drain_local_stock); | 6091 | INIT_WORK(&stock->work, drain_local_stock); |
| 6092 | } | 6092 | } |
| 6093 | hotcpu_notifier(memcg_cpu_hotplug_callback, 0); | ||
| 6094 | } else { | 6093 | } else { |
| 6095 | parent = mem_cgroup_from_cont(cont->parent); | 6094 | parent = mem_cgroup_from_cont(cont->parent); |
| 6096 | memcg->use_hierarchy = parent->use_hierarchy; | 6095 | memcg->use_hierarchy = parent->use_hierarchy; |
| @@ -6756,6 +6755,19 @@ struct cgroup_subsys mem_cgroup_subsys = { | |||
| 6756 | .use_id = 1, | 6755 | .use_id = 1, |
| 6757 | }; | 6756 | }; |
| 6758 | 6757 | ||
| 6758 | /* | ||
| 6759 | * The rest of init is performed during ->css_alloc() for root css which | ||
| 6760 | * happens before initcalls. hotcpu_notifier() can't be done together as | ||
| 6761 | * it would introduce circular locking by adding cgroup_lock -> cpu hotplug | ||
| 6762 | * dependency. Do it from a subsys_initcall(). | ||
| 6763 | */ | ||
| 6764 | static int __init mem_cgroup_init(void) | ||
| 6765 | { | ||
| 6766 | hotcpu_notifier(memcg_cpu_hotplug_callback, 0); | ||
| 6767 | return 0; | ||
| 6768 | } | ||
| 6769 | subsys_initcall(mem_cgroup_init); | ||
| 6770 | |||
| 6759 | #ifdef CONFIG_MEMCG_SWAP | 6771 | #ifdef CONFIG_MEMCG_SWAP |
| 6760 | static int __init enable_swap_account(char *s) | 6772 | static int __init enable_swap_account(char *s) |
| 6761 | { | 6773 | { |
