Re: [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks

From: Viresh Kumar
Date: Wed Jul 26 2017 - 23:23:38 EST


On 26-07-17, 19:42, Rafael J. Wysocki wrote:
> On Wednesday, July 26, 2017 02:52:32 PM Viresh Kumar wrote:

> > + /* Don't allow remote callbacks */
> > + if (smp_processor_id() != data->cpu)
> > + return;
>
> You can do this check against cpu->cpu, however.
>
> > + /* Don't allow remote callbacks */
> > + if (smp_processor_id() != data->cpu)
> > + return;
>
> And same here.
>
> > +
> > if (flags & SCHED_CPUFREQ_IOWAIT) {
> > cpu->iowait_boost = int_tofp(1);
> > } else if (cpu->iowait_boost) {
> > diff --git a/include/linux/sched/cpufreq.h b/include/linux/sched/cpufreq.h
> > index d2be2ccbb372..8256a8f35f22 100644
> > --- a/include/linux/sched/cpufreq.h
> > +++ b/include/linux/sched/cpufreq.h
> > @@ -16,6 +16,7 @@
> > #ifdef CONFIG_CPU_FREQ
> > struct update_util_data {
> > void (*func)(struct update_util_data *data, u64 time, unsigned int flags);
> > + unsigned int cpu;
>
> So it looks like you don't need this.
>
> schedutil doesn't need it as per patch [2/3].

Hmm, so your comments are exactly same as what Peter suggested few
days back.

sugov_get_util() uses it in 2/3, as we need to know the target CPU
anyway.

But I think it would be better to add the cpu variable in sugov_cpu
structure instead as only schedutil needs it. I will do that change
and send V5.

--
viresh