Thread (9 messages) 9 messages, 1 author, 2012-02-09
STALE5233d

[PATCH RT 5/8] timer-fd: Prevent live lock

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2012-02-09 02:02:50
Also in: lkml
Subsystem: filesystems (vfs and infrastructure), posix clocks and timers, the rest · Maintainers: Alexander Viro, Christian Brauner, Anna-Maria Behnsen, Frederic Weisbecker, Thomas Gleixner, Linus Torvalds

From: Thomas Gleixner <redacted>

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 <redacted>
Signed-off-by: Thomas Gleixner <redacted>
Cc: stable-rt@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 fs/timerfd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/timerfd.c b/fs/timerfd.c
index dffeb37..57f0e4e 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -313,7 +313,7 @@ SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags,
 		if (hrtimer_try_to_cancel(&ctx->tmr) >= 0)
 			break;
 		spin_unlock_irq(&ctx->wqh.lock);
-		cpu_relax();
+		hrtimer_wait_for_timer(&ctx->tmr);
 	}
 
 	/*
-- 
1.7.8.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help