Re: [PATCH V3 1/6] sched: idle: Add a weak arch_cpu_idle_poll function

Peter Zijlstra
2014-11-10T12:30:04Z

On Fri, Nov 07, 2014 at 03:31:22PM +0100, Daniel Lezcano wrote:
> The poll function is called when a timer expired or if we force to poll when
> the cpu_idle_force_poll option is set.
>
> The poll function does:
>
> local_irq_enable();
> while (!tif_need_resched())
> cpu_relax();
>
> This default poll function suits for the x86 arch because its rep; nop;
> hardware power optimization. But on other archs, this optimization does not
> exists and we are not saving power. The arch specific bits may want to
> optimize this loop by adding their own optimization.

This doesn't make sense to me; should an arch not either implement an
actual idle driver or implement cpu_relax() properly, why allow for a
third weird option?