• P
    cpufreq: schedutil: Cleanup and document iowait boost · fd7d5287
    Patrick Bellasi 提交于
    The iowait boosting code has been recently updated to add a progressive
    boosting behavior which allows to be less aggressive in boosting tasks
    doing only sporadic IO operations, thus being more energy efficient for
    example on mobile platforms.
    
    The current code is now however a bit convoluted. Some functionalities
    (e.g. iowait boost reset) are replicated in different paths and their
    documentation is slightly misaligned.
    
    Let's cleanup the code by consolidating all the IO wait boosting related
    functionality within within few dedicated functions and better define
    their role:
    
    - sugov_iowait_boost: set/increase the IO wait boost of a CPU
    - sugov_iowait_apply: apply/reduce the IO wait boost of a CPU
    
    Both these two function are used at every sugov update and they make
    use of a unified IO wait boost reset policy provided by:
    
    - sugov_iowait_reset: reset/disable the IO wait boost of a CPU
         if a CPU is not updated for more then one tick
    
    This makes possible a cleaner and more self-contained design for the IO
    wait boosting code since the rest of the sugov update routines, both for
    single and shared frequency domains, follow the same template:
    
       /* Configure IO boost, if required */
       sugov_iowait_boost()
    
       /* Return here if freq change is in progress or throttled */
    
       /* Collect and aggregate utilization information */
       sugov_get_util()
       sugov_aggregate_util()
    
       /*
        * Add IO boost, if currently enabled, on top of the aggregated
        * utilization value
        */
       sugov_iowait_apply()
    
    As a extra bonus, let's also add the documentation for the new
    functions and better align the in-code documentation.
    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>
    fd7d5287
cpufreq_schedutil.c 21.0 KB