On Fri, 3 Oct 2014, Rik van Riel wrote:
We have 3 different goals when selecting a runqueue for a task:
- locality: get the task running close to where it has stuff cached
- work preserving: get the task running ASAP, and preferably on a fully idle core
- idle state latency: place the task on a CPU that can start running it ASAP
We may also consider the interplay of the above 3 to have an impact on 4) power use: pack tasks on some CPUs so other CPUs can go into deeper idle states
In my mind the actual choice is between (1) and (2). Once you decided on (2) then obviously you should imply (3) all the time. And by having (3) then (4) should be a natural side effect by not selecting idle CPUs randomly.
By selecting (1) you already have (4).
The deficient part right now is (3) as a consequence of (2). Fixing (3) should not have to affect (1).
The current implementation is a "compromise" between (1) and (2), with a strong preference for (2), falling back to (1) if no fully idle core is found.
My ugly hack isn't any better, trading off (1) in order to be better at (2) and (3). Whether it even affects (4) remains to be seen.
(4) is greatly influenced by (3) on mobile platforms, especially those with a cluster topology. This might not be as significant on server type systems, although performance should benefit as well from the smaller wake-up latency.
On a mobile system losing 10% performance to save 20% on power usage might be an excellent compromise. Maybe not so on a server system where performance is everything.
Nicolas