From: Anna-Maria Gleixner Date: Tue, 30 Jul 2019 22:33:51 +0000 (+0200) Subject: itimers: Prepare for PREEMPT_RT X-Git-Tag: v5.4-rc1~159^2~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c7e6d704a0097e59667495cf52dcc4e1085e620b;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20190730223828.690771827@linutronix.de --- diff --git a/kernel/time/itimer.c b/kernel/time/itimer.c index 02068b2d5862c..9d26fd4ba4c0f 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);