cpuidle - fix lock contention in the idle path
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Linaro PMWG Kernel |
Fix Committed
|
High
|
Daniel Lezcano |
Bug Description
Commit bf4d1b5 (cpuidle: support multiple drivers) introduced
locking in cpuidle_
idle_call() function.
This leads to a contention problem with a large number of CPUs,
because they all try to run the idle routine at the same time.
The lock can be safely removed because of how is used the cpuidle
API. Namely, cpuidle_
cpuidle idle function is not entered before cpuidle_
is called, because the cpuidle device is not enabled then. Moreover,
cpuidle_
NULL, is not called before cpuidle_
All of the cpuidle drivers use the API in the same way.
In general, a cleanup around the lock is necessary and a proper
refcounting mechanism should be used to ensure the consistency in the
API (for example, cpuidle_
driver's refcount is not 0). However, these modifications will require
some code reorganization and rewrite which will be too intrusive for
a fix.
Fixed with commit ac34d7c8c87c247 db0270285950753 da045acaad