Re: [PATCH] RCU: don't turn off lockdep when find suspicious rcu_dereference_check() usage

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

On Wed, Apr 21, 2010 at 02:35:43PM -0700, Paul E. McKenney wrote:

And as Tetsuo Handa pointed out privately, my patch was way broken.

Here is an updated version.

							Thanx, Paul

commit b15e561ed91b7a366c3cc635026f3b9ce6483070
Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Date:   Wed Apr 21 14:04:56 2010 -0700

    sched: protect __sched_setscheduler() access to cgroups
    
    A given task's cgroups structures must remain while that task is running
    due to reference counting, so this is presumably a false positive.
    Updated to reflect feedback from Tetsuo Handa.
    
    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

diff --git a/kernel/sched.c b/kernel/sched.c
index 14c44ec..f425a2b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4575,9 +4575,13 @@ recheck:
 		 * Do not allow realtime tasks into groups that have no runtime
 		 * assigned.
 		 */
+		rcu_read_lock();
 		if (rt_bandwidth_enabled() && rt_policy(policy) &&
-				task_group(p)->rt_bandwidth.rt_runtime == 0)
+				task_group(p)->rt_bandwidth.rt_runtime == 0) {
+			rcu_read_unlock();
 			return -EPERM;
+		}
+		rcu_read_unlock();
 #endif
 
 		retval = security_task_setscheduler(p, policy, param);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ..., Paul E. McKenney, (Wed Apr 21, 2:48 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ..., Eric W. Biederman, (Wed Apr 21, 4:26 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ..., Paul E. McKenney, (Fri Apr 23, 12:42 pm)
[PATCH v2.6.34-rc5 01/12] rcu: Fix RCU lockdep splat in se ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 02/12] rcu: fix RCU lockdep splat on fr ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 03/12] rcu: leave lockdep enabled after ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 04/12] NFSv4: Fix the locking in nfs_in ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 05/12] NFS: Fix RCU issues in the NFSv4 ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 06/12] KEYS: Fix an RCU warning, Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 07/12] KEYS: Fix an RCU warning in the ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 08/12] cgroup: Fix an RCU warning in cg ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 09/12] cgroup: Fix an RCU warning in al ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 10/12] sched: Fix an RCU warning in pri ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 11/12] cgroup: Check task_lock in task_ ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
[PATCH v2.6.34-rc5 12/12] memcg: css_id() must be called u ..., Paul E. McKenney, (Fri Apr 23, 12:43 pm)
Re: [PATCH] RCU: don't turn off lockdep when find suspicio ..., Eric W. Biederman, (Mon Apr 26, 11:35 am)