]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
rt: Introduce cpu_chill()
authorThomas Gleixner <tglx@linutronix.de>
Wed, 7 Mar 2012 19:51:03 +0000 (20:51 +0100)
committerMichal Sojka <sojka@merica.cz>
Sun, 13 Sep 2015 07:47:29 +0000 (09:47 +0200)
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
include/linux/delay.h

index a6ecb34cf547da29ad16edf8b109de2511d10cd5..e23a7c021eeb1d08e643024b2b2d5ec2afd360b5 100644 (file)
@@ -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) */