Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1697732

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

From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject Re: [Eas-dev] [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks
Date 2017-07-27 08:00 +0200
Message-ID <u7K02-2bI-17@gated-at.bofh.it> (permalink)
References <u7qNI-6Vf-3@gated-at.bofh.it> <u7qNI-6Vf-15@gated-at.bofh.it> <u7JGF-25a-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 26-07-17, 22:34, Joel Fernandes (Google) wrote:
> On Wed, Jul 26, 2017 at 2:22 AM, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > @@ -221,7 +226,7 @@ static void sugov_update_single(struct update_util_data *hook, u64 time,
> >         sugov_set_iowait_boost(sg_cpu, time, flags);
> >         sg_cpu->last_update = time;
> >
> > -       if (!sugov_should_update_freq(sg_policy, time))
> > +       if (!sugov_should_update_freq(sg_policy, time, hook->cpu))
> >                 return;
> 
> Since with the remote callbacks now possible, isn't it unsafe to
> modify sg_cpu and sg_policy structures without a lock in
> sugov_update_single?
> 
> Unlike sugov_update_shared, we don't acquire any lock in
> sugov_update_single before updating these structures. Did I miss
> something?

As Peter already mentioned it earlier, the callbacks are called with
rq locks held and so sugov_update_single() wouldn't get called in
parallel for a target CPU.

That's the only race you were worried about ?

-- 
viresh

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH V4 0/3] sched: cpufreq: Allow remote callbacks Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-26 11:30 +0200
  [PATCH V4 2/3] cpufreq: schedutil: Process remote callback for shared policies Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-26 11:30 +0200
    Re: [Eas-dev] [PATCH V4 2/3] cpufreq: schedutil: Process remote  callback for shared policies "Joel Fernandes (Google)" <joel.opensrc@gmail.com> - 2017-07-27 07:50 +0200
  [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-26 11:30 +0200
    Re: [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-26 20:00 +0200
      Re: [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-27 05:30 +0200
    Re: [Eas-dev] [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks "Joel Fernandes (Google)" <joel.opensrc@gmail.com> - 2017-07-27 07:40 +0200
      Re: [Eas-dev] [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq  callbacks Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-27 08:00 +0200
        Re: [Eas-dev] [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks "Joel Fernandes (Google)" <joel.opensrc@gmail.com> - 2017-07-27 08:20 +0200
          Re: [Eas-dev] [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq  callbacks Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-27 09:20 +0200
            Re: [Eas-dev] [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq  callbacks Peter Zijlstra <peterz@infradead.org> - 2017-07-27 11:20 +0200
            Re: [Eas-dev] [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks "Joel Fernandes (Google)" <joel.opensrc@gmail.com> - 2017-07-28 05:40 +0200
    Re: [PATCH V4 1/3] sched: cpufreq: Allow remote cpufreq callbacks Peter Zijlstra <peterz@infradead.org> - 2017-07-27 12:00 +0200
  [PATCH V4 3/3] cpufreq: governor: Process remote callback for shared policies Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-26 11:30 +0200
  Re: [Eas-dev] [PATCH V4 0/3] sched: cpufreq: Allow remote callbacks "Joel Fernandes (Google)" <joel.opensrc@gmail.com> - 2017-07-27 07:20 +0200
    Re: [Eas-dev] [PATCH V4 0/3] sched: cpufreq: Allow remote callbacks Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-27 07:50 +0200
      Re: [Eas-dev] [PATCH V4 0/3] sched: cpufreq: Allow remote callbacks "Joel Fernandes (Google)" <joel.opensrc@gmail.com> - 2017-07-27 08:30 +0200
        Re: [Eas-dev] [PATCH V4 0/3] sched: cpufreq: Allow remote callbacks Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-27 09:20 +0200
        Re: [Eas-dev] [PATCH V4 0/3] sched: cpufreq: Allow remote callbacks Juri Lelli <juri.lelli@arm.com> - 2017-07-27 09:30 +0200
          Re: [Eas-dev] [PATCH V4 0/3] sched: cpufreq: Allow remote callbacks "Joel Fernandes (Google)" <joel.opensrc@gmail.com> - 2017-07-28 05:50 +0200

csiph-web