summaryrefslogtreecommitdiff
path: root/kernel/sched/hmp.c
diff options
context:
space:
mode:
authorSyed Rameez Mustafa <rameezmustafa@codeaurora.org>2017-01-04 15:56:51 -0800
committerSyed Rameez Mustafa <rameezmustafa@codeaurora.org>2017-01-10 11:01:52 -0800
commit47f7e0415af9fd1078b51a45a7b18701eb7d5177 (patch)
tree3cc1dc68321f14a7b2e520ec02bbacc9a6452383 /kernel/sched/hmp.c
parenta6d83d2e8ed916c5a097c7c047dc39cb9183b0e9 (diff)
sched: Convert the global wake_up_idle flag to a per cluster flag
Since clusters can vary significantly in the power and performance characteristics, there may be a need to have different CPU selection policies based on which cluster a task is being placed on. For example the placement policy can be more aggressive in using idle CPUs on cluster that are power efficient and less aggressive on clusters that are geared towards performance. Add support for per cluster wake_up_idle flag to allow greater flexibility in placement policies. Change-Id: I18cd3d907cd965db03a13f4655870dc10c07acfe Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Diffstat (limited to 'kernel/sched/hmp.c')
-rw-r--r--kernel/sched/hmp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/kernel/sched/hmp.c b/kernel/sched/hmp.c
index 180e2fcf785b..12fa618a8135 100644
--- a/kernel/sched/hmp.c
+++ b/kernel/sched/hmp.c
@@ -377,6 +377,7 @@ struct sched_cluster init_cluster = {
.dstate_wakeup_latency = 0,
.exec_scale_factor = 1024,
.notifier_sent = 0,
+ .wake_up_idle = 0,
};
static void update_all_clusters_stats(void)
@@ -677,6 +678,19 @@ unsigned int sched_get_static_cluster_pwr_cost(int cpu)
return cpu_rq(cpu)->cluster->static_cluster_pwr_cost;
}
+int sched_set_cluster_wake_idle(int cpu, unsigned int wake_idle)
+{
+ struct sched_cluster *cluster = cpu_rq(cpu)->cluster;
+
+ cluster->wake_up_idle = !!wake_idle;
+ return 0;
+}
+
+unsigned int sched_get_cluster_wake_idle(int cpu)
+{
+ return cpu_rq(cpu)->cluster->wake_up_idle;
+}
+
/*
* sched_window_stats_policy and sched_ravg_hist_size have a 'sysctl' copy
* associated with them. This is required for atomic update of those variables