1. 06 5月, 2016 1 次提交
    • R
      cpufreq: governor: Fix handling of special cases in dbs_update() · 9485e4ca
      Rafael J. Wysocki 提交于
      As reported in KBZ 69821:
      
      "With CONFIG_HZ_PERIODIC=y cpu stays at the lowest frequcency 800MHz
       even if usage goes to 100%, frequency does not scale up, the governor
       in use is ondemand. Neither works conservative. Performance and
       userspace governors work as expected.
      
       With CONFIG_NO_HZ_IDLE or CONFIG_NO_HZ_FULL cpu scales up with ondemand
       as expected."
      
      Analysis carried out by Chen Yu leads to the conclusion that the
      observed issue is due to idle_time in dbs_update() representing a
      negative number in which case the function will return 0 as the load
      (unless load is greater than 0 for another CPU sharing the policy),
      although that need not be the right choice.
      
      Indeed, idle_time representing a negative number means that during
      the last sampling interval the CPU was almost 100% busy on the rough
      average, so 100 should be returned as the load in that case.
      
      Modify the code accordingly and rearrange it to clarify the handling
      of all of the special cases in it.  While at it, also avoid returning
      zero as the load if time_elapsed is 0 (it doesn't really make sense
      to return 0 then).
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=69821Tested-by: NChen Yu <yu.c.chen@intel.com>
      Tested-by: NTimo Valtoaho <timo.valtoaho@gmail.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      9485e4ca
  2. 28 4月, 2016 1 次提交
  3. 25 4月, 2016 2 次提交
    • R
      cpufreq: governor: Fix prev_load initialization in cpufreq_governor_start() · ba1ca654
      Rafael J. Wysocki 提交于
      The way cpufreq_governor_start() initializes j_cdbs->prev_load is
      questionable.
      
      First off, j_cdbs->prev_cpu_wall used as a denominator in the
      computation may be zero.  The case this happens is when
      get_cpu_idle_time_us() returns -1 and get_cpu_idle_time_jiffy()
      used to return that number is called exactly at the jiffies_64
      wrap time.  It is rather hard to trigger that error, but it is not
      impossible and it will just crash the kernel then.
      
      Second, j_cdbs->prev_load is computed as the average load during
      the entire time since the system started and it may not reflect the
      load in the previous sampling period (as it is expected to).
      That doesn't play well with the way dbs_update() uses that value.
      Namely, if the update time delta (wall_time) happens do be greater
      than twice the sampling rate on the first invocation of it, the
      initial value of j_cdbs->prev_load (which may be completely off) will
      be returned to the caller as the current load (unless it is equal to
      zero and unless another CPU sharing the same policy object has a
      greater load value).
      
      For this reason, notice that the prev_load field of struct cpu_dbs_info
      is only used by dbs_update() and only in that one place, so if
      cpufreq_governor_start() is modified to always initialize it to 0,
      it will make dbs_update() always compute the actual load first time
      it checks the update time delta against the doubled sampling rate
      (after initialization) and there won't be any side effects of it.
      
      Consequently, modify cpufreq_governor_start() as described.
      
      Fixes: 18b46abd (cpufreq: governor: Be friendly towards latency-sensitive bursty workloads)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      ba1ca654
    • R
      Revert "cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC" · 94862a62
      Rafael J. Wysocki 提交于
      Revert commit 0df35026 (cpufreq: governor: Fix negative idle_time
      when configured with CONFIG_HZ_PERIODIC) that introduced a regression
      by causing the ondemand cpufreq governor to misbehave for
      CONFIG_TICK_CPU_ACCOUNTING unset (the frequency goes up to the max at
      one point and stays there indefinitely).
      
      The revert takes subsequent modifications of the code in question into
      account.
      
      Fixes: 0df35026 (cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC)
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=115261Reported-and-tested-by: NTimo Valtoaho <timo.valtoaho@gmail.com>
      Cc: 4.5+ <stable@vger.kernel.org> # 4.5+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      94862a62
  4. 02 4月, 2016 3 次提交
  5. 23 3月, 2016 1 次提交
  6. 11 3月, 2016 1 次提交
  7. 09 3月, 2016 31 次提交