aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-02-25 10:04:03 -0500
committerTejun Heo <tj@kernel.org>2014-02-25 10:04:03 -0500
commit0e1d768f1b1873272ec4e8dc1482bb5281855017 (patch)
tree8c8156afaa83e9d647c0202d63112b4be6a240d1 /include/linux/cgroup.h
parenteaf797abc53b0ab3f0a02d4ef873a565fcce6daa (diff)
cgroup: drop task_lock() protection around task->cgroups
For optimization, task_lock() is additionally used to protect task->cgroups. The optimization is pretty dubious as either css_set_rwsem is grabbed anyway or PF_EXITING already protects task->cgroups. It adds only overhead and confusion at this point. Let's drop task_[un]lock() and update comments accordingly. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Li Zefan <lizefan@huawei.com>
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 4829a577c1b9..acbb9a4cb6e9 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -658,10 +658,12 @@ struct cgroup_subsys_state *css_parent(struct cgroup_subsys_state *css)
658 */ 658 */
659#ifdef CONFIG_PROVE_RCU 659#ifdef CONFIG_PROVE_RCU
660extern struct mutex cgroup_mutex; 660extern struct mutex cgroup_mutex;
661extern struct rw_semaphore css_set_rwsem;
661#define task_css_set_check(task, __c) \ 662#define task_css_set_check(task, __c) \
662 rcu_dereference_check((task)->cgroups, \ 663 rcu_dereference_check((task)->cgroups, \
663 lockdep_is_held(&(task)->alloc_lock) || \ 664 lockdep_is_held(&cgroup_mutex) || \
664 lockdep_is_held(&cgroup_mutex) || (__c)) 665 lockdep_is_held(&css_set_rwsem) || \
666 ((task)->flags & PF_EXITING) || (__c))
665#else 667#else
666#define task_css_set_check(task, __c) \ 668#define task_css_set_check(task, __c) \
667 rcu_dereference((task)->cgroups) 669 rcu_dereference((task)->cgroups)