On Mon, Jan 20, 2014 at 03:00:29AM -0800, H. Peter Anvin wrote: > On 01/20/2014 01:55 AM, Peter Zijlstra wrote: > > > > Ok, so I still don't get the problem of enabling interrupts early. > > > > If we enable them early we can get interrupts; which afaict fall into > > two groups, those that do and do not set NEED_RESCHED. > > > > For those that do not set NEED_RESCHED, we'd have woken from MWAIT/HLT > > and looped right back into it, so receiving those early -- before > > actually calling MWAIT/HLT seems like a NO-OP. > > The description for commit d331e739f5ad seems to indicate otherwise: > > Idle callbacks has some races when enter_idle() sets isidle and > subsequent > interrupts that can happen on that CPU, before CPU goes to idle. Due > to this, > an IDLE_END can get called before IDLE_START. To avoid these races, > disable > interrupts before enter_idle and make sure that all idle routines do not > enable interrupts before entering idle. > > This implies to me that once we have set isidle, if we take an interrupt > we *have* to drop out of the idle routine. I don't think that applies anymore; the generic idle loop calls arch_cpu_idle_enter() before calling arch_cpu_idle() where we would do the enable. So in that sense its impossible to get arch_cpu_idle_exit() -- or rather exit_idle() as called from the interrupts -- to happen before arch_cpu_idle_enter(). -- To unsubscribe from this list: send the line "unsubscribe linux-next" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html