[PATCH tip/core/urgent 2/5] rcu: fix RCU lockdep splat on freezer_fork path

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Wednesday, April 21, 2010 - 1:02 pm

Add an RCU read-side critical section to suppress this false positive.

Located-by: Eric Paris <eparis@parisplace.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
---
 kernel/cgroup_freezer.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index da5e139..e5c0244 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -205,9 +205,12 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task)
 	 * No lock is needed, since the task isn't on tasklist yet,
 	 * so it can't be moved to another cgroup, which means the
 	 * freezer won't be removed and will be valid during this
-	 * function call.
+	 * function call.  Nevertheless, apply RCU read-side critical
+	 * section to suppress RCU lockdep false positives.
 	 */
+	rcu_read_lock();
 	freezer = task_freezer(task);
+	rcu_read_unlock();
 
 	/*
 	 * The root cgroup is non-freezable, so we can skip the
-- 
1.7.0

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH tip/core/urgent] fix several lockdep splats, allow ..., Paul E. McKenney, (Wed Apr 21, 1:01 pm)
[PATCH tip/core/urgent 1/5] rcu: Fix RCU lockdep splat in ..., Paul E. McKenney, (Wed Apr 21, 1:02 pm)
[PATCH tip/core/urgent 2/5] rcu: fix RCU lockdep splat on ..., Paul E. McKenney, (Wed Apr 21, 1:02 pm)
[tip:core/urgent] rcu: Fix RCU lockdep splat in set_task_c ..., tip-bot for Peter Zi ..., (Fri Apr 30, 3:51 am)
[tip:core/urgent] rcu: Fix RCU lockdep splat on freezer_fo ..., tip-bot for Paul E. ..., (Fri Apr 30, 3:51 am)
Re: [PATCH tip/core/urgent] fix several lockdep splats, al ..., Mathieu Desnoyers, (Fri Apr 30, 8:33 am)
Re: [PATCH tip/core/urgent] fix several lockdep splats, al ..., Paul E. McKenney, (Fri Apr 30, 11:02 am)
Re: [PATCH tip/core/urgent] fix several lockdep splats, al ..., Mathieu Desnoyers, (Fri Apr 30, 11:12 am)
Re: [PATCH tip/core/urgent] fix several lockdep splats, al ..., Paul E. McKenney, (Fri Apr 30, 11:32 am)
Re: [PATCH tip/core/urgent] fix several lockdep splats, al ..., Mathieu Desnoyers, (Fri Apr 30, 12:09 pm)