diff options
author | Li Zefan <lizefan@huawei.com> | 2013-03-12 10:28:39 +0800 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-03-12 14:25:25 -0700 |
commit | cfb5966bef85412dab9c93553db10b3e99ac32e8 (patch) | |
tree | a0cf5d9513f8b9a97af9bd5e186ff611493a8e93 /kernel/cpuset.c | |
parent | ff794dea52eaaa09017efea688a1d7f92ab0818e (diff) | |
download | lwn-cfb5966bef85412dab9c93553db10b3e99ac32e8.tar.gz lwn-cfb5966bef85412dab9c93553db10b3e99ac32e8.zip |
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.c | 2 |
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) 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(); } /* |