-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BACKPORT: sched/uclamp: Filter out uclamp_max for small tasks
DISCLAIMER: ===================================================================== This patch is intended to go upstream after collecting feedback from Android community that it resolves the issues reported by various partners. It is not meant to be merged into android-mainline. ===================================================================== uclamp_max effectiveness could be easily impacted by small transient tasks that wake up frequency to do small work then go back to sleep. If there's a busy task that is capped by uclamp_max to run at a smaller frequency, due to max-aggregation rule tasks that wake up on the same cpu will increase the rq->uclamp_max value if they were higher than the capped task. Given that all tasks by default have a uclamp_max = 1024, this is the likely case by default. Note that since the capped task is likely to be a busy and throttled one, its util, and hence the rq->util, will be very high and as soon as we lift the capping the requested frequency will be very high. To address this issue of increasing the resilience of uclamp_max against these transient tasks that don't really need to run at a higher frequency, we implement a simple filter mechanism to ignore uclamp_max for those tasks. The algorithm looks at the runtime of the task and compares it to sched_slice(). By default we assume any task that its runtime is 1/4th of sched_slice() or less is a small transient task that we can ignore its uclamp_max requirement. runtime < sched_slice() / divider We can tweak the divider by /proc/sys/kernel/sched_util_uclamp_max_filter_divider sysctl. It accepts values 0-4. divider = 1 << sched_util_uclamp_max_filter_divider We add a new task_tick_uclamp() function to verify this condition periodically and ensure the conditions checked at wake up are still true - in case this transient task suddenly becomes a busy one. For EAS, we can't use sched_slice() there to figure out if uclamp_max will be ignored because the task is not enqueued yet. So we leave it as-is to figure out the placement based on worst case scenario. Signed-off-by: Qais Yousef <[email protected]> Change-Id: Ie3afa93a7d70dab5b7c22e820cc078ffd0e891ef [yaro: ported to msm-5.4 and remove sysctl parts for now] Signed-off-by: Yaroslav Furman <[email protected]>
- Loading branch information
1 parent
7a49bfe
commit d07fca6
Showing
5 changed files
with
188 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters