From: Stephen Rothwell Date: Fri, 23 Sep 2011 03:55:03 +0000 (+1000) Subject: Merge remote-tracking branch 'rcu/rcu/next' X-Git-Tag: next-20110923~19 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=71a83d8d487d3454cec5ab90e776103d481b0273;p=karo-tx-linux.git Merge remote-tracking branch 'rcu/rcu/next' --- 71a83d8d487d3454cec5ab90e776103d481b0273 diff --cc include/linux/rcupdate.h index 8f4f881a0ad8,9d40e425d46c..ea9bc708ccef --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@@ -238,8 -313,18 +313,18 @@@ extern int rcu_read_lock_bh_held(void) * * Check debug_lockdep_rcu_enabled() to prevent false positives during boot * and while lockdep is disabled. + * + * Note that if the CPU is in an extended quiescent state, for example, + * if the CPU is in dyntick-idle mode, then rcu_read_lock_held() returns + * false even if the CPU did an rcu_read_lock(). The reason for this is + * that RCU ignores CPUs that are in extended quiescent states, so such + * a CPU is effectively never in an RCU read-side critical section + * regardless of what RCU primitives it invokes. This state of affairs + * is required -- RCU would otherwise need to periodically wake up + * dyntick-idle CPUs, which would defeat the whole purpose of dyntick-idle + * mode. */ -#ifdef CONFIG_PREEMPT +#ifdef CONFIG_PREEMPT_COUNT static inline int rcu_read_lock_sched_held(void) { int lockdep_opinion = 0; diff --cc kernel/sched.c index 433e18ffab22,313c0f63e29a..881678a06ab1 --- a/kernel/sched.c +++ b/kernel/sched.c @@@ -8372,8 -8185,10 +8362,9 @@@ static inline int preempt_count_equals( void __might_sleep(const char *file, int line, int preempt_offset) { -#ifdef in_atomic static unsigned long prev_jiffy; /* ratelimiting */ + rcu_sleep_check(); /* WARN_ON_ONCE() by default, no rate limit reqd. */ if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) || system_state != SYSTEM_RUNNING || oops_in_progress) return;