rcu: Make non-RCU_PROVE_LOCKING rcu_read_lock_sched_held() understand boot
authorPaul E. McKenney <[email protected]>
Sat, 27 Feb 2010 00:38:57 +0000 (16:38 -0800)
committerIngo Molnar <[email protected]>
Sat, 27 Feb 2010 08:53:52 +0000 (09:53 +0100)
Before the scheduler starts, all tasks are non-preemptible by
definition. So, during that time, rcu_read_lock_sched_held()
needs to always return "true".  This patch makes that be so
for RCU_PROVE_LOCKING=n.

Signed-off-by: Paul E. McKenney <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
LKML-Reference: <1267231138[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
include/linux/rcupdate.h

index fcea332a84244396072977afbb32e65a902ede05..c84373626336c8afa29e14d14a0868034394ffe6 100644 (file)
@@ -166,7 +166,7 @@ static inline int rcu_read_lock_bh_held(void)
 
 static inline int rcu_read_lock_sched_held(void)
 {
-       return preempt_count() != 0;
+       return preempt_count() != 0 || !rcu_scheduler_active;
 }
 
 #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */