summaryrefslogtreecommitdiff
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
authorOlav Haugan <ohaugan@codeaurora.org>2015-08-10 16:41:44 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:02:27 -0700
commit03a683a55c450e26f1ebde7400f64a4b7ecd68c2 (patch)
tree89d641bf72662652aff71607161baac88b731110 /kernel/sched/core.c
parent4996dafe6875f2804d525e6ac74162e3efc4cda3 (diff)
sched: Add tunables for static cpu and cluster cost
Add per-cpu tunable to set the extra cost to use a CPU that is idle. Add the same for a cluster. Change-Id: I4aa53f3c42c963df7abc7480980f747f0413d389 Signed-off-by: Olav Haugan <ohaugan@codeaurora.org> [joonwoop@codeaurora.org: omitted changes for qhmp*.[c,h] stripped out CONFIG_SCHED_QHMP in drivers/base/cpu.c and include/linux/sched.h] Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r--kernel/sched/core.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 1150d8665ac8..7b874fb5ebcd 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1168,6 +1168,32 @@ static inline void clear_hmp_request(int cpu)
}
}
+int sched_set_static_cpu_pwr_cost(int cpu, unsigned int cost)
+{
+ struct rq *rq = cpu_rq(cpu);
+
+ rq->static_cpu_pwr_cost = cost;
+ return 0;
+}
+
+unsigned int sched_get_static_cpu_pwr_cost(int cpu)
+{
+ return cpu_rq(cpu)->static_cpu_pwr_cost;
+}
+
+int sched_set_static_cluster_pwr_cost(int cpu, unsigned int cost)
+{
+ struct rq *rq = cpu_rq(cpu);
+
+ rq->static_cluster_pwr_cost = cost;
+ return 0;
+}
+
+unsigned int sched_get_static_cluster_pwr_cost(int cpu)
+{
+ return cpu_rq(cpu)->static_cluster_pwr_cost;
+}
+
#else
static inline int got_boost_kick(void)
@@ -9398,6 +9424,9 @@ void __init sched_init(void)
rq->cur_irqload = 0;
rq->avg_irqload = 0;
rq->irqload_ts = 0;
+ rq->static_cpu_pwr_cost = 0;
+ rq->static_cluster_pwr_cost = 0;
+
#ifdef CONFIG_SCHED_FREQ_INPUT
rq->curr_runnable_sum = rq->prev_runnable_sum = 0;
rq->old_busy_time = 0;