drivers: cpuidle: lpm-levels: Notify sched of idle state entry/exit
When entering a sleep mode, idle drivers notifies scheduler to help scheduler make better scheduling decisions by not waking up sleeping CPUs/clusters.i The change was left out of original 4.4 merge due to dependency on scheduler changes. Change-Id: Id366432ac4acca390692ef810adbd6edec4a5bfb Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
This commit is contained in:
parent
8257cc8ac8
commit
78c5836a96
1 changed files with 8 additions and 0 deletions
|
@ -680,6 +680,8 @@ static int cluster_configure(struct lpm_cluster *cluster, int idx,
|
|||
/* Notify cluster enter event after successfully config completion */
|
||||
cluster_notify(cluster, level, true);
|
||||
|
||||
sched_set_cluster_dstate(&cluster->child_cpus, idx, 0, 0);
|
||||
|
||||
cluster->last_level = idx;
|
||||
return 0;
|
||||
|
||||
|
@ -816,6 +818,7 @@ static void cluster_unprepare(struct lpm_cluster *cluster,
|
|||
BUG_ON(ret);
|
||||
|
||||
}
|
||||
sched_set_cluster_dstate(&cluster->child_cpus, 0, 0, 0);
|
||||
|
||||
cluster_notify(cluster, &cluster->levels[last_level], false);
|
||||
cluster_unprepare(cluster->parent, &cluster->child_cpus,
|
||||
|
@ -1015,6 +1018,10 @@ static int lpm_cpuidle_enter(struct cpuidle_device *dev,
|
|||
int64_t start_time = ktime_to_ns(ktime_get()), end_time;
|
||||
struct power_params *pwr_params;
|
||||
|
||||
pwr_params = &cluster->cpu->levels[idx].pwr;
|
||||
sched_set_cpu_cstate(smp_processor_id(), idx + 1,
|
||||
pwr_params->energy_overhead, pwr_params->latency_us);
|
||||
|
||||
pwr_params = &cluster->cpu->levels[idx].pwr;
|
||||
|
||||
cpu_prepare(cluster, idx, true);
|
||||
|
@ -1034,6 +1041,7 @@ exit:
|
|||
|
||||
cluster_unprepare(cluster, cpumask, idx, true, end_time);
|
||||
cpu_unprepare(cluster, idx, true);
|
||||
sched_set_cpu_cstate(smp_processor_id(), 0, 0, 0);
|
||||
|
||||
trace_cpu_idle_exit(idx, success);
|
||||
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, dev->cpu);
|
||||
|
|
Loading…
Add table
Reference in a new issue