Re: [PATCH 9/12] cpufreq: governor: Move per-CPU data to the common code

From: Viresh Kumar
Date: Thu Feb 18 2016 - 01:08:39 EST


On 18-02-16, 02:31, Rafael J. Wysocki wrote:
> @@ -464,21 +455,24 @@ static void od_set_powersave_bias(unsign
>
> get_online_cpus();
> for_each_online_cpu(cpu) {
> + struct cpufreq_policy *policy;
> struct policy_dbs_info *policy_dbs;
> + struct dbs_data *dbs_data;
> + struct od_dbs_tuners *od_tuners;
>
> if (cpumask_test_cpu(cpu, &done))
> continue;
>
> - policy_dbs = per_cpu(od_cpu_dbs_info, cpu).cdbs.policy_dbs;
> + policy = cpufreq_cpu_get_raw(cpu);

This is surely racy, as this might get called while governors are
getting exchanged. But this is racy today as well.

We should be using the list of policies present with the governors
here, with dbs_data->lock or something like that.


Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

--
viresh