summaryrefslogtreecommitdiff
path: root/fs/timerfd.c
diff options
context:
space:
mode:
authorAnna-Maria Gleixner <anna-maria@linutronix.de>2019-07-31 01:33:50 +0300
committerThomas Gleixner <tglx@linutronix.de>2019-08-01 21:51:23 +0300
commita125ecc16453a4fe0ba865c7df87b9c722991fdf (patch)
tree959dbc9c47895ea4ca3cd06cf95b5a3cbbf081d7 /fs/timerfd.c
parent51ae33092bb8320497ec75ddc5ab383d8fafd55c (diff)
downloadlinux-a125ecc16453a4fe0ba865c7df87b9c722991fdf.tar.xz
timerfd: Prepare for PREEMPT_RT
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 <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.600085866@linutronix.de
Diffstat (limited to 'fs/timerfd.c')
-rw-r--r--fs/timerfd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c
index 6a6fc8aa1de7..48305ba41e3c 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -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);
}
/*