Skip to content

Commit

Permalink
cgroup: move init_css_set initialization inside cgroup_mutex
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tejun Heo committed Jun 25, 2013
1 parent 5549c49 commit 82fe9b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -4888,14 +4888,14 @@ int __init cgroup_init(void)
cgroup_init_idr(ss, init_css_set.subsys[ss->subsys_id]);
}

/* Add init_css_set to the hash table */
key = css_set_hash(init_css_set.subsys);
hash_add(css_set_table, &init_css_set.hlist, key);

/* allocate id for the dummy hierarchy */
mutex_lock(&cgroup_mutex);
mutex_lock(&cgroup_root_mutex);

/* Add init_css_set to the hash table */
key = css_set_hash(init_css_set.subsys);
hash_add(css_set_table, &init_css_set.hlist, key);

BUG_ON(cgroup_init_root_id(&cgroup_dummy_root));

mutex_unlock(&cgroup_root_mutex);
Expand Down

0 comments on commit 82fe9b0

Please sign in to comment.