On Wed, Nov 27, 2013 at 06:26:49AM +0000, Paul Turner wrote:
On Tue, Nov 26, 2013 at 10:04 PM, Alex Shi alex.shi@linaro.org wrote:
On 11/22/2013 05:57 PM, Morten Rasmussen wrote:
load_avg_contrib is not updated while the task is sleeping. It will be updated when the task is reinserted into a runqueue at wakeup. That fact that is retains its old (non-decayed) value is a very useful feature as it allows us to see how the task behaved last time it ran no matter how long it has been sleeping. That is not currently exploited in the mainline scheduler, but it is very important for energy-aware scheduling (and big.LITTLE scheduler support).
For example, webbrowser rendering it quite cpu intensive but doesn't happen very often. So its 'true' load_avg_contrib would be 0, but since it isn't updated we can see that it ran for a long time last time it was scheduled and schedule it on an appropriate cpu instead of assuming that it is a small task.
Yes. If such scenarios happens often, maybe worthy to add a new load_avg_contrib variable to store the old value that you wanted.
I think you are misunderstanding Morten here. He is only highlighting that for highly aperiodic tasks we may (note we do not currently) take advantage of the fact that we can examine them _before_ the load_contrib is updated to reflect their new value. One can imagine such a heuristic might be enabled when we saw that the blocked period exceeded a certain thresh-hold for instance.
Yes, exactly.
For big.LITTLE we do have heuristics based on this in some of the Linaro kernel trees and that work quite well for this particular purpose. We basically control wake up affinity based on task load_contrib. Examining the load_contrib before it is updated ensures that aperiodic bursty tasks don't wake up on a little cpu because it load has decayed to 0.
We would like to have similar big.LITTLE support (in a more generic form) upstream, but that is somewhere down the list of things to do for energy-aware scheduling.