I tested it on ARM Cortex-A9 dual core with different priorities and with and without CPU affinities and it works like a charm. Thanks a bunch, Thomas and Mike. I wonder why my test worked for priority 1 alone before (without this fix) and I did not see any other threads using RT scheduler in the system with priority 1 or 2. On Wed, Jan 25, 2012 at 4:11 AM, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote: > 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); > } > > /* -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html