From ea408e3da40df36ea828ac753c3d2978722d8dfa Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 25 Jan 2012 11:08:40 +0100 Subject: 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 Signed-off-by: Thomas Gleixner Cc: stable-rt@vger.kernel.org diff --git a/fs/timerfd.c b/fs/timerfd.c index 9293121..d20e45a 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -380,7 +380,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); } /* -- cgit v0.10.2