blob: 8f6afe7f386e1524a2ab6e20faa5b4b313a1e5aa [file] [log] [blame]
Subject: timer-fd: Prevent live lock
From: Thomas Gleixner <tglx@linutronix.de>
Date: Wed, 25 Jan 2012 11:08:40 +0100
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>
Cc: stable-rt@vger.kernel.org
---
fs/timerfd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-stable/fs/timerfd.c
===================================================================
--- linux-stable.orig/fs/timerfd.c
+++ linux-stable/fs/timerfd.c
@@ -313,7 +313,7 @@ SYSCALL_DEFINE4(timerfd_settime, int, uf
if (hrtimer_try_to_cancel(&ctx->tmr) >= 0)
break;
spin_unlock_irq(&ctx->wqh.lock);
- cpu_relax();
+ hrtimer_wait_for_timer(&ctx->tmr);
}
/*