diff options
author | Tejun Heo <tj@kernel.org> | 2013-06-25 14:53:37 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-06-25 14:53:37 -0400 |
commit | 82fe9b0da0d50e2795a49c268676fd132cbc3eea (patch) | |
tree | 5a8bce47e8612886a71f680826cfbcba731a0ba3 | |
parent | 5549c497913ad860d3dff4386c6423268bb85693 (diff) |
cgroup: move init_css_set initialization inside cgroup_mutex
cgroup_init() was doing init_css_set initialization outside
cgroup_mutex, which is fine but we want to add lockdep annotation on
subsystem iterations and cgroup_init() will trigger it spuriously.
Move init_css_set initialization inside cgroup_mutex.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
-rw-r--r-- | kernel/cgroup.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 605cb13a1574..3409698bd9fd 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -4888,14 +4888,14 @@ int __init cgroup_init(void) | |||
4888 | cgroup_init_idr(ss, init_css_set.subsys[ss->subsys_id]); | 4888 | cgroup_init_idr(ss, init_css_set.subsys[ss->subsys_id]); |
4889 | } | 4889 | } |
4890 | 4890 | ||
4891 | /* Add init_css_set to the hash table */ | ||
4892 | key = css_set_hash(init_css_set.subsys); | ||
4893 | hash_add(css_set_table, &init_css_set.hlist, key); | ||
4894 | |||
4895 | /* allocate id for the dummy hierarchy */ | 4891 | /* allocate id for the dummy hierarchy */ |
4896 | mutex_lock(&cgroup_mutex); | 4892 | mutex_lock(&cgroup_mutex); |
4897 | mutex_lock(&cgroup_root_mutex); | 4893 | mutex_lock(&cgroup_root_mutex); |
4898 | 4894 | ||
4895 | /* Add init_css_set to the hash table */ | ||
4896 | key = css_set_hash(init_css_set.subsys); | ||
4897 | hash_add(css_set_table, &init_css_set.hlist, key); | ||
4898 | |||
4899 | BUG_ON(cgroup_init_root_id(&cgroup_dummy_root)); | 4899 | BUG_ON(cgroup_init_root_id(&cgroup_dummy_root)); |
4900 | 4900 | ||
4901 | mutex_unlock(&cgroup_root_mutex); | 4901 | mutex_unlock(&cgroup_root_mutex); |