• Dietmar Eggemann's avatar
    sched/fair, cpufreq: Introduce 'runnable boosting' · 7d0583cf
    Dietmar Eggemann authored
    The responsiveness of the Per Entity Load Tracking (PELT) util_avg in
    mobile devices is still considered too low for utilization changes
    during task ramp-up.
    
    In Android this manifests in the fact that the first frames of a UI
    activity are very prone to be jankframes (a frame which doesn't meet
    the required frame rendering time, e.g. 16ms@60Hz) since the CPU
    frequency is normally low at this point and has to ramp up quickly.
    
    The beginning of an UI activity is also characterized by the occurrence
    of CPU contention, especially on little CPUs. Current little CPUs can
    have an original CPU capacity of only ~ 150 which means that the actual
    CPU capacity at lower frequency can even be much smaller.
    
    Schedutil maps CPU util_avg into CPU frequency request via:
    
      util = effective_cpu_util(..., cpu_util_cfs(cpu), ...) ->
      util = map_util_perf(util) -> freq = map_util_freq(util, ...)
    
    CPU contention for CFS tasks can be detected by 'CPU runnable > CPU
    utililization' in cpu_util_cfs_boost() -> cpu_util(..., boost = 1).
    Schedutil uses 'runnable boosting' by calling cpu_util_cfs_boost().
    
    To be in sync with schedutil's CPU frequency selection, Energy Aware
    Scheduling (EAS) also calls cpu_util(..., boost = 1) during max util
    detection.
    
    Moreover, 'runnable boosting' is also used in load-balance for busiest
    CPU selection when the migration type is 'migrate_util', i.e. only at
    sched domains which don't have the SD_SHARE_PKG_RESOURCES flag set.
    Suggested-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
    Signed-off-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Reviewed-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
    Link: https://lore.kernel.org/r/20230515115735.296329-3-dietmar.eggemann@arm.com
    7d0583cf
sched.h 89.3 KB