Skip to content

Commit c7e6d70

Browse files
anna-marialxKAGA-KOKO
authored andcommitted
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 <anna-maria@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20190730223828.690771827@linutronix.de
1 parent a125ecc commit c7e6d70

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎kernel/time/itimer.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue)
213213
/* We are sharing ->siglock with it_real_fn() */
214214
if (hrtimer_try_to_cancel(timer) < 0) {
215215
spin_unlock_irq(&tsk->sighand->siglock);
216+
hrtimer_cancel_wait_running(timer);
216217
goto again;
217218
}
218219
expires = timeval_to_ktime(value->it_value);

0 commit comments

Comments
 (0)