aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-03-07 20:51:03 +0100
committerSteven Rostedt <rostedt@goodmis.org>2012-03-13 20:09:06 -0400
commit7d135247e1fb0388361ba96b4216cc72541224ee (patch)
tree86fabba78458c6a9af34143e95b23bbc37662d03
parent658f23316a7ef61527cf870418ed7bc67b9ad37b (diff)
rt: Introduce cpu_chill()
Retry loops on RT might loop forever when the modifying side was preempted. Add cpu_chill() to replace cpu_relax(). cpu_chill() defaults to cpu_relax() for non RT. On RT it puts the looping task to sleep for a tick so the preempted task can make progress. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable-rt@vger.kernel.org Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--include/linux/delay.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/delay.h b/include/linux/delay.h
index a6ecb34cf547..e23a7c021eeb 100644
--- a/include/linux/delay.h
+++ b/include/linux/delay.h
@@ -52,4 +52,10 @@ static inline void ssleep(unsigned int seconds)
msleep(seconds * 1000);
}
+#ifdef CONFIG_PREEMPT_RT_FULL
+# define cpu_chill() msleep(1)
+#else
+# define cpu_chill() cpu_relax()
+#endif
+
#endif /* defined(_LINUX_DELAY_H) */