weighted_cpuload() gives the sum of priority scaled task loads. One
NICE 0 task is not be enough load to trigger a cpu capacity increase
when cpu_power > 1024. The rq->avg.runnable_avg_sum tracks the actual
busy time of the cpu and is therefore a more accurate indication of
the cpu load. If the rq tracked load is high the cpu is busy even if
the weighted_cpuload() should indicate otherwise.

Signed-off-by: Morten Rasmussen <[email protected]>
---
 kernel/sched/fair.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ea8d973..ee87e65 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2861,7 +2861,17 @@ static inline void inc_cpu_capacity(int cpu, struct 
task_struct *p)
        if (p && p->flags & PF_WQ_WORKER)
                return;
 
-       if (weighted_cpuload(cpu) > power_of(cpu))
+       if (weighted_cpuload(cpu) > power_of(cpu)) {
+               go_faster(cpu, 0);
+               return;
+       }
+
+       /*
+        * Go faster if the cpu is 80% busy. This threshold should
+        * be set by the power driver later.
+        */
+       if (cpu_rq(cpu)->avg.runnable_avg_sum * 100 >
+               80 * cpu_rq(cpu)->avg.runnable_avg_period)
                go_faster(cpu, 0);
 }
 
-- 
1.7.9.5


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to