diff options
author | Wang Long <wanglong19@meituan.com> | 2017-11-19 16:08:37 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2017-11-27 11:37:33 -0800 |
commit | ddf7005f32212f28669032651e09bd8d2245c35d (patch) | |
tree | 5fb56a56fcdfed62892a8e662d53f893a18c11ca /kernel/cgroup | |
parent | 1599a185f0e6113be185b9fb809c621c73865829 (diff) | |
download | linux-ddf7005f32212f28669032651e09bd8d2245c35d.tar.gz linux-ddf7005f32212f28669032651e09bd8d2245c35d.tar.bz2 linux-ddf7005f32212f28669032651e09bd8d2245c35d.zip |
debug cgroup: use task_css_set instead of rcu_dereference
This macro `task_css_set` verifies that the caller is
inside proper critical section if the kernel set CONFIG_PROVE_RCU=y.
Signed-off-by: Wang Long <wanglong19@meituan.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup')
-rw-r--r-- | kernel/cgroup/debug.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/cgroup/debug.c b/kernel/cgroup/debug.c index 5f780d8f6a9d..9caeda610249 100644 --- a/kernel/cgroup/debug.c +++ b/kernel/cgroup/debug.c @@ -50,7 +50,7 @@ static int current_css_set_read(struct seq_file *seq, void *v) spin_lock_irq(&css_set_lock); rcu_read_lock(); - cset = rcu_dereference(current->cgroups); + cset = task_css_set(current); refcnt = refcount_read(&cset->refcount); seq_printf(seq, "css_set %pK %d", cset, refcnt); if (refcnt > cset->nr_tasks) @@ -96,7 +96,7 @@ static int current_css_set_cg_links_read(struct seq_file *seq, void *v) spin_lock_irq(&css_set_lock); rcu_read_lock(); - cset = rcu_dereference(current->cgroups); + cset = task_css_set(current); list_for_each_entry(link, &cset->cgrp_links, cgrp_link) { struct cgroup *c = link->cgrp; |