On Thu, Oct 22, 2009 at 8:34 PM, Gregory Haskins <ghaskins@xxxxxxxxxx> wrote: > Yes, that is right. irq_disable is a effective superset of preempt-disable() in this context because it also blocks those RESCHED_IPI events from being received. Of course, disabling interrupts also has other side effects since it also disables *all* interrupts (like timers, etc) so it should be used sparingly. In this case, we are simply bridging the preempt_enable_no_resched() and schedule() to make sure it is truly an atomic transition to a sleep state, so its use is justified. > > I hope this helps, and feel free to ask any more questions you wish. Thanks. Yes it make sense to me. Another question may be basic - but I just cannot figure out. Why PREEMPT_RT patch disables local irq (with local_irq_disable()) before __schedule()? Is it to ensure atomic excution of __schedule()? If so, does that mean, linux kernel without PREEMPT_RT patch suffers from racy problem in schedule()? asmlinkage void __sched schedule(void) { need_resched: local_irq_disable(); __schedule(); local_irq_enable(); if (need_resched()) goto need_resched; } I saw similiar code in preempt_schedule(), __cond_schedule() and preempt_schedule_irq(). Regards, -Yi -- 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