This repository has been archived by the owner on Jul 16, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EAS.ver.]: cpufreq: schedutil: Use exponential frequency selection
As of currently, schedutil takes the maximum CPU frequency, multiplies it by 1.5 (or + freq / 2), then multiplies that by the current load ratio. The resulting data is a linear equation, where the maximum CPU frequency is selected at approximately ~66.667% load. If the load is anything greater, the maximum CPU frequency is still selected. The reported load for Android usage allows schedutil to make efficient frequency changes to maintain throughput, however, perceivable jank is not accounted for. Some kernel hackers opt for some form on CPU boosting, whether it be minimum frequency capping, schedtune boosting, or the use of msm_performance userspace control. As an alternative idea, schedutil could act upon it's reported load in an exponential fashion. Placing the load into a square root allows schedutil to pick higher frequencies more often, especially around the middle loads. At its highest point, this algorithm can boost frequency selection by ~1.5x. The benefit of this method over other boosting concepts is that the minimum and maximum selections are kept in-tact. This means that at 0% load, schedutil will still pick the lowest available frequency, and at 100% load, schedutil will still pick the highest available frequency that is inline with the original algorithm. We need to use int_sqrt when calculating the square root, which returns an integer. Unfortunately, we need a ratio in the form of an unsigned decimal. We need to perform the square root with a scalar and then divide by the square root of that scalar later to find the square root of the decimal. @THEBOSS619: Adapt it to EAS's SchedUtil Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>
- Loading branch information