linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] debug cgroup: use task_css_set instead of rcu_dereference
@ 2017-11-19 21:08 Wang Long
  2017-11-27 19:38 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Wang Long @ 2017-11-19 21:08 UTC (permalink / raw)
  To: tj; +Cc: longman, kstewart, gregkh, linux-kernel

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>
---
 kernel/cgroup/debug.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/cgroup/debug.c b/kernel/cgroup/debug.c
index 5f780d8..9caeda6 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;
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] debug cgroup: use task_css_set instead of rcu_dereference
  2017-11-19 21:08 [PATCH] debug cgroup: use task_css_set instead of rcu_dereference Wang Long
@ 2017-11-27 19:38 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2017-11-27 19:38 UTC (permalink / raw)
  To: Wang Long; +Cc: longman, kstewart, gregkh, linux-kernel

On Sun, Nov 19, 2017 at 04:08:37PM -0500, Wang Long wrote:
> 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>

Applied to cgroup/for-4.15-fixes.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-27 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-19 21:08 [PATCH] debug cgroup: use task_css_set instead of rcu_dereference Wang Long
2017-11-27 19:38 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).