Skip to content

Commit

Permalink
timerfd: Prepare for PREEMPT_RT
Browse files Browse the repository at this point in the history
Use the hrtimer_cancel_wait_running() synchronization mechanism to prevent
priority inversion and live locks on PREEMPT_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]
  • Loading branch information
anna-marialx authored and KAGA-KOKO committed Aug 1, 2019
1 parent 51ae330 commit a125ecc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/timerfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,11 @@ static int do_timerfd_settime(int ufd, int flags,
break;
}
spin_unlock_irq(&ctx->wqh.lock);
cpu_relax();

if (isalarm(ctx))
hrtimer_cancel_wait_running(&ctx->t.alarm.timer);
else
hrtimer_cancel_wait_running(&ctx->t.tmr);
}

/*
Expand Down

0 comments on commit a125ecc

Please sign in to comment.