public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpuset: fix RCU lockdep splat in cpuset_print_task_mems_allowed()
@ 2013-03-12  2:28 Li Zefan
  2013-03-12 21:25 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zefan @ 2013-03-12  2:28 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Sasha Levin, LKML, Cgroups

Sasha reported a lockdep warning when OOM was triggered. The reason
is cgroup_name() should be called with rcu_read_lock() held.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Li Zefan <lizefan@huawei.com>
---

This fix is for 3.10

---
 kernel/cpuset.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index c55763b..98d458a 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2599,6 +2599,7 @@ void cpuset_print_task_mems_allowed(struct task_struct *tsk)
 
 	struct cgroup *cgrp = task_cs(tsk)->css.cgroup;
 
+	rcu_read_lock();
 	spin_lock(&cpuset_buffer_lock);
 
 	nodelist_scnprintf(cpuset_nodelist, CPUSET_NODELIST_LEN,
@@ -2607,6 +2608,7 @@ void cpuset_print_task_mems_allowed(struct task_struct *tsk)
 	       tsk->comm, cgroup_name(cgrp), cpuset_nodelist);
 
 	spin_unlock(&cpuset_buffer_lock);
+	rcu_read_unlock();
 }
 
 /*
-- 
1.8.0.2

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

* Re: [PATCH] cpuset: fix RCU lockdep splat in cpuset_print_task_mems_allowed()
  2013-03-12  2:28 [PATCH] cpuset: fix RCU lockdep splat in cpuset_print_task_mems_allowed() Li Zefan
@ 2013-03-12 21:25 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2013-03-12 21:25 UTC (permalink / raw)
  To: Li Zefan; +Cc: Sasha Levin, LKML, Cgroups

On Tue, Mar 12, 2013 at 10:28:39AM +0800, Li Zefan wrote:
> Sasha reported a lockdep warning when OOM was triggered. The reason
> is cgroup_name() should be called with rcu_read_lock() held.
> 
> Reported-by: Sasha Levin <sasha.levin@oracle.com>
> Signed-off-by: Li Zefan <lizefan@huawei.com>

Applied to cgroup/for-3.10.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2013-03-12 21:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-12  2:28 [PATCH] cpuset: fix RCU lockdep splat in cpuset_print_task_mems_allowed() Li Zefan
2013-03-12 21:25 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox