On Wed, Jul 10, 2013 at 02:05:00PM +0100, Arjan van de Ven wrote:
also, it almost looks like there is a fundamental assumption in the code that you can get the current effective P state to make scheduler decisions on; on Intel at least that is basically impossible... and getting more so with every generation (likewise for AMD afaics)
(you can get what you ran at on average over some time in the past, but not what you're at now or going forward)
As described above, it is not a strict assumption. From a scheduler point of view we somehow need to know if the cpus are truly fully utilized (at their highest P-state)
unfortunately we can't provide this on Intel ;-( we can provide you what you ran at average, we cannot provide you if that is the max or not
(first of all, because we outright don't know what the max would have been, and second, because we may be running slower than max because the workload was memory bound or any of the other conditions that makes the HW P state "governor" decide to reduce frequency for efficiency reasons)
I guess even if we have a constant CPU frequency (no turbo boost), we still don't have a simple relation between the load as seen by the scheduler and the CPU frequency (for reasons that you mentioned above like memory-bound tasks).
But on x86 you still have a P-state hint for the CPU and the scheduler could at least hope for more CPU performance. We can make the power scheduler ask the power driver for an increase or decrease of performance (as Preeti suggested) and give it the current load as argument rather than a precise performance/frequency level. The power driver would change the P-state accordingly and take the load into account (or ignore it, something like intel_pstate.c can do its own aperf/mperf tracking). But the power driver will inform the scheduler that it can't change the P-state further and the power scheduler can decide to spread the load out to other CPUs.