Skip to content

Commit d0486ea

Browse files
kerneltoastvbajs
authored andcommitted
schedutil: Allow CPU frequency changes to be amended before they're set
If the last CPU frequency selected isn't set before a new CPU frequency selection arrives, then use the new selection immediately to avoid using a stale frequency choice. This improves both performance and energy by more closely tracking the scheduler's latest decisions. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Signed-off-by: Yahya Wessam <yahyawessam2002@gmail.com>
1 parent bc77108 commit d0486ea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

kernel/sched/cpufreq_schedutil.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
110110
sg_policy->need_freq_update = true;
111111
return true;
112112
}
113+
114+
/* If the last frequency wasn't set yet then we can still amend it */
115+
if (sg_policy->work_in_progress)
116+
return true;
117+
113118
/* No need to recalculate next freq for min_rate_limit_us
114119
* at least. However we might still decide to further rate
115120
* limit once frequency change direction is decided, according

0 commit comments

Comments
 (0)