summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-01-25 11:08:40 +0100
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2016-12-23 17:14:18 +0100
commitce1cef5fa1d5936c7e926c0530f702f90084e08a (patch)
tree6a58098a374cf693824b0a74e9e02dc079027bc1 /fs
parent77abf4fa0b9d4587604a870392070e2640c433e8 (diff)
downloadlinux-rt-ce1cef5fa1d5936c7e926c0530f702f90084e08a.tar.gz
timer-fd: Prevent live lock
If hrtimer_try_to_cancel() requires a retry, then depending on the priority setting te retry loop might prevent timer callback completion on RT. Prevent that by waiting for completion on RT, no change for a non RT kernel. Reported-by: Sankara Muthukrishnan <sankara.m@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/timerfd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c
index 9ae4abb4110b..8644b67c48fd 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -460,7 +460,10 @@ static int do_timerfd_settime(int ufd, int flags,
break;
}
spin_unlock_irq(&ctx->wqh.lock);
- cpu_relax();
+ if (isalarm(ctx))
+ hrtimer_wait_for_timer(&ctx->t.alarm.timer);
+ else
+ hrtimer_wait_for_timer(&ctx->t.tmr);
}
/*