aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2012-01-25 11:08:40 +0100
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2016-02-13 00:34:54 +0100
commit6ddc4322d1e6fa68af6f115d75ab43ece47e2489 (patch)
tree808163dae14510412cfcc82decabda755ba725c2
parent9b47be3023f73e402fa84fccf745ff58cfe7cfd0 (diff)
downloadrt-linux-6ddc4322d1e6fa68af6f115d75ab43ece47e2489.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>
-rw-r--r--fs/timerfd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/timerfd.c b/fs/timerfd.c
index b94fa6c3c6ebe..64fb860662378 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -450,7 +450,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);
}
/*