aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cpuset.c
diff options
context:
space:
mode:
authorLi Zefan <lizefan@huawei.com>2013-03-11 22:28:39 -0400
committerTejun Heo <tj@kernel.org>2013-03-12 17:25:25 -0400
commitcfb5966bef85412dab9c93553db10b3e99ac32e8 (patch)
treea0cf5d9513f8b9a97af9bd5e186ff611493a8e93 /kernel/cpuset.c
parentff794dea52eaaa09017efea688a1d7f92ab0818e (diff)
cpuset: fix RCU lockdep splat in cpuset_print_task_mems_allowed()
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> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cpuset.c')
-rw-r--r--kernel/cpuset.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index ace5bfcdcb30..efbfca7a33e4 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2599,6 +2599,7 @@ void cpuset_print_task_mems_allowed(struct task_struct *tsk)
2599 2599
2600 struct cgroup *cgrp = task_cs(tsk)->css.cgroup; 2600 struct cgroup *cgrp = task_cs(tsk)->css.cgroup;
2601 2601
2602 rcu_read_lock();
2602 spin_lock(&cpuset_buffer_lock); 2603 spin_lock(&cpuset_buffer_lock);
2603 2604
2604 nodelist_scnprintf(cpuset_nodelist, CPUSET_NODELIST_LEN, 2605 nodelist_scnprintf(cpuset_nodelist, CPUSET_NODELIST_LEN,
@@ -2607,6 +2608,7 @@ void cpuset_print_task_mems_allowed(struct task_struct *tsk)
2607 tsk->comm, cgroup_name(cgrp), cpuset_nodelist); 2608 tsk->comm, cgroup_name(cgrp), cpuset_nodelist);
2608 2609
2609 spin_unlock(&cpuset_buffer_lock); 2610 spin_unlock(&cpuset_buffer_lock);
2611 rcu_read_unlock();
2610} 2612}
2611 2613
2612/* 2614/*