Commit 78347cdb authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

cpufreq: governor: Reset sample delay in store_sampling_rate()

If store_sampling_rate() updates the sample delay when the ondemand
governor is in the middle of its high/low dance (OD_SUB_SAMPLE sample
type is set), the governor will still do the bottom half of the
previous sample which may take too much time.

To prevent that from happening, change store_sampling_rate() to always
reset the sample delay to 0 which also is consistent with the new
behavior of cpufreq_governor_limits().
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 4cccf755
...@@ -38,10 +38,6 @@ EXPORT_SYMBOL_GPL(dbs_data_mutex); ...@@ -38,10 +38,6 @@ EXPORT_SYMBOL_GPL(dbs_data_mutex);
* reducing the sampling rate, we need to make the new value effective * reducing the sampling rate, we need to make the new value effective
* immediately. * immediately.
* *
* On the other hand, if new rate is larger than the old, then we may evaluate
* the load too soon, and it might we worth updating sample_delay_ns then as
* well.
*
* This must be called with dbs_data->mutex held, otherwise traversing * This must be called with dbs_data->mutex held, otherwise traversing
* policy_dbs_list isn't safe. * policy_dbs_list isn't safe.
*/ */
...@@ -69,18 +65,14 @@ ssize_t store_sampling_rate(struct dbs_data *dbs_data, const char *buf, ...@@ -69,18 +65,14 @@ ssize_t store_sampling_rate(struct dbs_data *dbs_data, const char *buf,
* really doesn't matter. If the read returns a value that's * really doesn't matter. If the read returns a value that's
* too big, the sample will be skipped, but the next invocation * too big, the sample will be skipped, but the next invocation
* of dbs_update_util_handler() (when the update has been * of dbs_update_util_handler() (when the update has been
* completed) will take a sample. If the returned value is too * completed) will take a sample.
* small, the sample will be taken immediately, but that isn't a
* problem, as we want the new rate to take effect immediately
* anyway.
* *
* If this runs in parallel with dbs_work_handler(), we may end * If this runs in parallel with dbs_work_handler(), we may end
* up overwriting the sample_delay_ns value that it has just * up overwriting the sample_delay_ns value that it has just
* written, but the difference should not be too big and it will * written, but it will be corrected next time a sample is
* be corrected next time a sample is taken, so it shouldn't be * taken, so it shouldn't be significant.
* significant.
*/ */
gov_update_sample_delay(policy_dbs, dbs_data->sampling_rate); gov_update_sample_delay(policy_dbs, 0);
mutex_unlock(&policy_dbs->timer_mutex); mutex_unlock(&policy_dbs->timer_mutex);
} }
......
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