Re: [PATCH V3 2/6] sched: idle: cpuidle: Check the latency req before idle

From: Peter Zijlstra
Date: Mon Nov 10 2014 - 07:41:27 EST


On Fri, Nov 07, 2014 at 03:31:23PM +0100, Daniel Lezcano wrote:
> @@ -216,19 +219,26 @@ static void cpu_idle_loop(void)
> local_irq_disable();
> arch_cpu_idle_enter();
>
> + latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
> +
> /*
> * In poll mode we reenable interrupts and spin.
> *
> + * If the latency req is zero, we don't want to
> + * enter any idle state and we jump to the poll
> + * function directly
> + *
> * Also if we detected in the wakeup from idle
> * path that the tick broadcast device expired
> * for us, we don't want to go deep idle as we
> * know that the IPI is going to arrive right
> * away
> */
> - if (cpu_idle_force_poll || tick_check_broadcast_expired())
> + if (!latency_req || cpu_idle_force_poll ||
> + tick_check_broadcast_expired())
> cpu_idle_poll();

Is this why you wanted that weak poll function?

Should we not instead allow an arch to deal with !latency_req and only
fall back to this polling if there is no actual way for it to implement
this better?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/