Commit 8e3b4039 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

cpufreq: intel_pstate: Fix up iowait_boost computation

After commit b8bd1581 ("cpufreq: intel_pstate: Rework iowait
boosting to be less aggressive") the handling of the case when
the SCHED_CPUFREQ_IOWAIT flag is set again after a few iterations of
intel_pstate_update_util() is a bit inconsistent, because the
new value of cpu->iowait_boost may be lower than ONE_EIGHTH_FP
if it was set before, but has not dropped down to zero just yet.

Fix that up by ensuring that the new value of cpu->iowait_boost
will always be at least ONE_EIGHTH_FP then.

Fixes: b8bd1581 ("cpufreq: intel_pstate: Rework iowait boosting to be less aggressive")
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 9505b98c
...@@ -1762,7 +1762,7 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time, ...@@ -1762,7 +1762,7 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time,
/* Start over if the CPU may have been idle. */ /* Start over if the CPU may have been idle. */
if (delta_ns > TICK_NSEC) { if (delta_ns > TICK_NSEC) {
cpu->iowait_boost = ONE_EIGHTH_FP; cpu->iowait_boost = ONE_EIGHTH_FP;
} else if (cpu->iowait_boost) { } else if (cpu->iowait_boost >= ONE_EIGHTH_FP) {
cpu->iowait_boost <<= 1; cpu->iowait_boost <<= 1;
if (cpu->iowait_boost > int_tofp(1)) if (cpu->iowait_boost > int_tofp(1))
cpu->iowait_boost = int_tofp(1); cpu->iowait_boost = int_tofp(1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment