sched: HMP change nr_running offload metric
authorChris Redpath <chris.redpath@arm.com>
Mon, 19 Aug 2013 14:06:20 +0000 (15:06 +0100)
committerJon Medhurst <tixy@linaro.org>
Mon, 19 Aug 2013 14:41:37 +0000 (15:41 +0100)
rq->nr_running was better than cfs.nr_running, since it includes
all tasks actually on the CPU. However, it includes RT tasks which
we would rather ignore at this point.

Switching to cfs.h_nr_running includes all the CFS tasks but no
RT tasks.

Signed-off-by: Chris Redpath <chris.redpath@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Jon Medhurst <tixy@linaro.org>
kernel/sched/fair.c

index 78f6d028d29405cfedd9a9f42a64d9fbedcdd9bd..c7c41412f5e7f362d624a8ee8dbb63c52a9f735f 100644 (file)
@@ -4029,7 +4029,7 @@ static inline unsigned int hmp_offload_down(int cpu, struct sched_entity *se)
                return NR_CPUS;
 
        /* Is the task alone on the cpu? */
-       if (cpu_rq(cpu)->cfs.nr_running < 2)
+       if (cpu_rq(cpu)->cfs.h_nr_running < 2)
                return NR_CPUS;
 
        /* Is the task actually starving? */