aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna-Maria Gleixner <[email protected]>2019-07-31 00:33:51 +0200
committerThomas Gleixner <[email protected]>2019-08-01 20:51:24 +0200
commitc7e6d704a0097e59667495cf52dcc4e1085e620b (patch)
treec3775ba9173d0cff6fee1dbb7aee1ecb13ab9e5a
parenta125ecc16453a4fe0ba865c7df87b9c722991fdf (diff)
itimers: Prepare for PREEMPT_RT
Use the hrtimer_cancel_wait_running() synchronization mechanism to prevent priority inversion and live locks on PREEMPT_RT. As a benefit the retry loop gains the missing cpu_relax() on !RT. [ tglx: Split out of combo patch ] Signed-off-by: Anna-Maria Gleixner <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
-rw-r--r--kernel/time/itimer.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c
index 02068b2d5862..9d26fd4ba4c0 100644
--- a/kernel/time/itimer.c
+++ b/kernel/time/itimer.c
@@ -213,6 +213,7 @@ again:
/* We are sharing ->siglock with it_real_fn() */
if (hrtimer_try_to_cancel(timer) < 0) {
spin_unlock_irq(&tsk->sighand->siglock);
+ hrtimer_cancel_wait_running(timer);
goto again;
}
expires = timeval_to_ktime(value->it_value);