• P
    cpufreq: schedutil: Fix iowait boost reset · 295f1a99
    Patrick Bellasi 提交于
    A more energy efficient update of the IO wait boosting mechanism has
    been introduced in:
    
       commit a5a0809b ("cpufreq: schedutil: Make iowait boost more energy efficient")
    
    where the boost value is expected to be:
    
     - doubled at each successive wakeup from IO
       staring from the minimum frequency supported by a CPU
    
     - reset when a CPU is not updated for more then one tick
       by either disabling the IO wait boost or resetting its value to the
       minimum frequency if this new update requires an IO boost.
    
    This approach is supposed to "ignore" boosting for sporadic wakeups from
    IO, while still getting the frequency boosted to the maximum to benefit
    long sequence of wakeup from IO operations.
    
    However, these assumptions are not always satisfied.
    For example, when an IO boosted CPU enters idle for more the one tick
    and then wakes up after an IO wait, since in sugov_set_iowait_boost() we
    first check the IOWAIT flag, we keep doubling the iowait boost instead
    of restarting from the minimum frequency value.
    
    This misbehavior could happen mainly on non-shared frequency domains,
    thus defeating the energy efficiency optimization, but it can also
    happen on shared frequency domain systems.
    
    Let fix this issue in sugov_set_iowait_boost() by:
     - first check the IO wait boost reset conditions
       to eventually reset the boost value
     - then applying the correct IO boost value
       if required by the caller
    
    Fixes: a5a0809b (cpufreq: schedutil: Make iowait boost more energy efficient)
    Reported-by: NViresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: NPatrick Bellasi <patrick.bellasi@arm.com>
    Reviewed-by: NJoel Fernandes (Google) <joel@joelfernandes.org>
    Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
    Acked-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
    Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
    295f1a99
cpufreq_schedutil.c 18.5 KB