Skip to content

Commit

Permalink
schedutil: Allow CPU frequency changes to be amended before they're set
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Tashfin Shakeer Rhythm <[email protected]>
Signed-off-by: NotZeetaa <[email protected]>
  • Loading branch information
kerneltoast authored and TIMISONG-dev committed Jan 14, 2024
1 parent de1cbdf commit ba87689
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kernel/sched/cpufreq_schedutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time)
return true;
}

/* If the last frequency wasn't set yet then we can still amend it */
if (sg_policy->work_in_progress)
return true;

/* No need to recalculate next freq for min_rate_limit_us
* at least. However we might still decide to further rate
* limit once frequency change direction is decided, according
Expand Down

0 comments on commit ba87689

Please sign in to comment.