aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/cpufreq_schedutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/cpufreq_schedutil.c')
-rw-r--r--kernel/sched/cpufreq_schedutil.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index b1fedf9932d6..76877a62b5fa 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -494,7 +494,6 @@ static int sugov_init(struct cpufreq_policy *policy)
494{ 494{
495 struct sugov_policy *sg_policy; 495 struct sugov_policy *sg_policy;
496 struct sugov_tunables *tunables; 496 struct sugov_tunables *tunables;
497 unsigned int lat;
498 int ret = 0; 497 int ret = 0;
499 498
500 /* State should be equivalent to EXIT */ 499 /* State should be equivalent to EXIT */
@@ -533,10 +532,16 @@ static int sugov_init(struct cpufreq_policy *policy)
533 goto stop_kthread; 532 goto stop_kthread;
534 } 533 }
535 534
536 tunables->rate_limit_us = LATENCY_MULTIPLIER; 535 if (policy->transition_delay_us) {
537 lat = policy->cpuinfo.transition_latency / NSEC_PER_USEC; 536 tunables->rate_limit_us = policy->transition_delay_us;
538 if (lat) 537 } else {
539 tunables->rate_limit_us *= lat; 538 unsigned int lat;
539
540 tunables->rate_limit_us = LATENCY_MULTIPLIER;
541 lat = policy->cpuinfo.transition_latency / NSEC_PER_USEC;
542 if (lat)
543 tunables->rate_limit_us *= lat;
544 }
540 545
541 policy->governor_data = sg_policy; 546 policy->governor_data = sg_policy;
542 sg_policy->tunables = tunables; 547 sg_policy->tunables = tunables;