On 11/07/2014 08:01 PM, Daniel Lezcano wrote:
When the pmqos latency requirement is set to zero that means "poll in all the cases".
That is correctly implemented on x86 but not on the other archs.
As how is written the code, if the latency request is zero, the governor will return zero, so corresponding, for x86, to the poll function, but for the others arch the default idle function. For example, on ARM this is wait-for- interrupt with a latency of '1', so violating the constraint.
In order to fix that, do the latency requirement check *before* calling the cpuidle framework in order to jump to the poll function without entering cpuidle. That has several benefits:
- It clarifies and unifies the code
- It fixes x86 vs other archs behavior
- Factors out the call to the same function
- Prevent to enter the cpuidle framework with its expensive cost in calculation
As the latency_req is needed in all the cases, change the select API to take the latency_req as parameter in case it is not equal to zero.
As a positive side effect, it introduces the latency constraint specified externally, so one more step to the cpuidle/scheduler integration.
Signed-off-by: Daniel Lezcano daniel.lezcano@linaro.org Acked-by: Nicolas Pitre nico@linaro.org Acked-by: Peter Zijlstra (Intel) peterz@infradead.org Reviewed-by: Len Brown len.brown@intel.com
Reviewed-by: Preeti U Murthy preeti@linux.vnet.ibm.com
Regards Preeti U Murthy