cpuset: fix RCU lockdep splat in cpuset_print_task_mems_allowed()
PATCH 1/1 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 <[email protected]>
Signed-off-by Li Zefan <[email protected]>
---
This fix is for 3.10
--- kernel/cpuset.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/cpuset.c +2 -0
@@ -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 (); }/*
Signature · 1 line
1.8.0.2
Quoted 5 lines · Li Zefan
Sasha reported a lockdep warning when OOM was triggered. The reason is
cgroup_name()should be called withrcu_read_lock()held.Reported-by Sasha Levin <[email protected]>Signed-off-by Li Zefan <[email protected]>
Applied to cgroup/for-3.10.
Thanks.
Signature · 1 line
tejun