Thread (6 messages) 6 messages, 3 authors, 2012-01-26

Re: timerfd functions hang on both x86 and ARM with RT patch and RT scheduling policies

From: Thomas Gleixner <hidden>
Date: 2012-01-25 10:11:04

On Wed, 25 Jan 2012, Mike Galbraith wrote:
On Tue, 2012-01-24 at 10:04 -0600, Sankara Muthukrishnan wrote:
 		spin_unlock_irq(&ctx->wqh.lock);
+#ifndef CONFIG_PREEMPT_RT_BASE
Bah.
 		cpu_relax();
+#else
+		/*
+		 * Current may be an RT task with priority high enough
+		 * to prevent the thread currently _wanting_ to execute
+		 * the timer callback function from receiving the CPU.
+		 */
+		usleep_range(1, 10);
Even more bah.
+#endif
 	}
Index: linux-3.2/fs/timerfd.c
===================================================================
--- linux-3.2.orig/fs/timerfd.c
+++ linux-3.2/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);
 	}
 
 	/*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help