aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-06-07 09:19:06 +0200
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2016-02-13 00:34:56 +0100
commit2c165148a0bf656f49212bff28c58b6f5dffb78f (patch)
treed1410eb2d70b6e2678d54c97c779d32bebfe4e12
parent981eabf0b6a49a7f12897941df1aff6f319bba36 (diff)
downloadrt-linux-2c165148a0bf656f49212bff28c58b6f5dffb78f.tar.gz
sched: Do not account rcu_preempt_depth on RT in might_sleep()
RT changes the rcu_preempt_depth semantics, so we cannot check for it in might_sleep(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/linux/rcupdate.h7
-rw-r--r--kernel/sched/core.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index a0189ba67fde72..1eef045c95d154 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -292,6 +292,11 @@ void synchronize_rcu(void);
* types of kernel builds, the rcu_read_lock() nesting depth is unknowable.
*/
#define rcu_preempt_depth() (current->rcu_read_lock_nesting)
+#ifndef CONFIG_PREEMPT_RT_FULL
+#define sched_rcu_preempt_depth() rcu_preempt_depth()
+#else
+static inline int sched_rcu_preempt_depth(void) { return 0; }
+#endif
#else /* #ifdef CONFIG_PREEMPT_RCU */
@@ -317,6 +322,8 @@ static inline int rcu_preempt_depth(void)
return 0;
}
+#define sched_rcu_preempt_depth() rcu_preempt_depth()
+
#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
/* Internal to kernel */
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 900dca3928a457..f132965f825973 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7667,7 +7667,7 @@ void __init sched_init(void)
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
static inline int preempt_count_equals(int preempt_offset)
{
- int nested = preempt_count() + rcu_preempt_depth();
+ int nested = preempt_count() + sched_rcu_preempt_depth();
return (nested == preempt_offset);
}