Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1220443
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V2 2/9] cpufreq: conservative: remove 'enable' field |
| Date | 2015-09-08 03:40 +0200 |
| Message-ID | <q6g39-6ln-15@gated-at.bofh.it> (permalink) |
| References | <pQPHz-1DB-11@gated-at.bofh.it> <pQPHz-1DB-13@gated-at.bofh.it> <q6eum-42W-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 08-09-15, 02:17, Rafael J. Wysocki wrote:
> > static inline unsigned int get_freq_target(struct cs_dbs_tuners *cs_tuners,
> > struct cpufreq_policy *policy)
> > {
> > @@ -119,12 +132,14 @@ static int dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val,
> > struct cpufreq_freqs *freq = data;
> > struct cs_cpu_dbs_info_s *dbs_info =
> > &per_cpu(cs_cpu_dbs_info, freq->cpu);
> > - struct cpufreq_policy *policy;
> > + struct cpufreq_policy *policy = cpufreq_cpu_get(freq->cpu);
> >
> > - if (!dbs_info->enable)
> > + if (!policy)
> > return 0;
> >
> > - policy = dbs_info->cdbs.shared->policy;
>
> So here we could get to the policy directly. After the change we have to:
>
> - acquire cpufreq_rwsem
> - acquire cpufreq_driver_lock
> - go the kobject_get on policy->kobj
Hmm, actually we can do cpufreq_cpu_get_raw() here as this is getting
called from notifier and policy isn't going to get freed for sure.
And then it wouldn't be that bad.
> and then finally drop the reference to the kobject when we're done.
>
> So may I ask where exactly is the improvement?
Agree. Let me resend it quickly.
> > + /* policy isn't governed by conservative governor */
> > + if (policy->governor != &cpufreq_gov_conservative)
> > + goto policy_put;
> >
> > /*
> > * we only care if our internally tracked freq moves outside the 'valid'
>
> Thanks,
> Rafael
--
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH V2 2/9] cpufreq: conservative: remove 'enable' field "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-09-08 02:00 +0200 Re: [PATCH V2 2/9] cpufreq: conservative: remove 'enable' field Viresh Kumar <viresh.kumar@linaro.org> - 2015-09-08 03:40 +0200 [PATCH V3 2/9] cpufreq: conservative: remove 'enable' field Viresh Kumar <viresh.kumar@linaro.org> - 2015-09-08 03:50 +0200
csiph-web