Re: [PATCH V3 12/13] cpufreq: ondemand: Traverse list of policy_dbs in update_sampling_rate()

From: Viresh Kumar
Date: Mon Feb 08 2016 - 12:20:45 EST


On 08-02-16, 14:32, Rafael J. Wysocki wrote:
> The comment still applies.
>
> Moreover, please extend it to say that this must be called with
> dbs_data->mutex held (or it looks racy otherwise).

Modified it as:

+ *
+ * Simply updating dbs_tuners_int.sampling_rate might not be appropriate here.
+ * For example, if the original sampling_rate was 1 second and the requested new
+ * sampling rate is 10 ms because the user needs immediate reaction from
+ * ondemand governor, otherwise the governor may change the sampling rate too
+ * late; up to 1 second later.
+ *
+ * Similar logic applies while increasing the sampling rate. And so we need to
+ * update it with immediate effect.
+ *
+ * This must be called with dbs_data->mutex held, otherwise traversing
+ * policy_dbs_list isn't safe.

--
viresh