summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSai Charan Gurrappadi <sgurrappadi@nvidia.com>2012-07-25 08:37:14 -0700
committerVarun Colbert <vcolbert@nvidia.com>2012-08-24 19:08:13 -0700
commita1c9f879ab8da0c4fc0a9c75791de5ada0a2ffba (patch)
tree31cbfc68eac194d7e769c7c166bcb9feefd58771 /kernel
parent7d1d0e913d5c5a93a5f30b6508ae3cf66e3da92b (diff)
cpuquiet: Runnable threads governor
[perf] The runnable threads governor only looks at the average number of runnables in the system to make a decision when bringing cores offline/online. First pass; tweaks thresholds and delays to reduce decision latency to about ~50-70ms per core (from ~100-150ms per core) Change-Id: Idd3b268a74a8f56ad3fc0e5c7f388174d1b6611f Signed-off-by: Sai Charan Gurrappadi <sgurrappadi@nvidia.com> Reviewed-on: http://git-master/r/124679 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index eb15edd08a23..b8f4618407b2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2188,6 +2188,18 @@ unsigned long avg_nr_running(void)
return sum;
}
+unsigned long get_avg_nr_running(unsigned int cpu)
+{
+ struct rq *q;
+
+ if (cpu >= nr_cpu_ids)
+ return 0;
+
+ q = cpu_rq(cpu);
+
+ return q->ave_nr_running;
+}
+
/*
* Global load-average calculations
*