From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Vincent Guittot <vincent.guittot@linaro.org>,
smuckle.linux@gmail.com, juri.lelli@arm.com,
Morten.Rasmussen@arm.com, patrick.bellasi@arm.com,
eas-dev@lists.linaro.org
Subject: Re: [RFC 7/9] cpufreq: governor: support scheduler cpufreq callbacks on remote CPUs
Date: Tue, 11 Apr 2017 16:36:05 +0530 [thread overview]
Message-ID: <20170411110605.GD13627@vireshk-i7> (raw)
In-Reply-To: <3331999.EqKcTVSiQr@aspire.rjw.lan>
On 30-03-17, 00:14, Rafael J. Wysocki wrote:
> On Thursday, March 09, 2017 05:15:17 PM Viresh Kumar wrote:
> > From: Steve Muckle <smuckle.linux@gmail.com>
> >
> > In preparation for the scheduler cpufreq callback happening on remote
> > CPUs, add support for this in the legacy (ondemand and conservative)
> > governors. The legacy governors make assumptions about the callback
> > occurring on the CPU being updated.
> >
> > Signed-off-by: Steve Muckle <smuckle.linux@gmail.com>
> > [ vk: minor updates in commit log ]
> > Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> > ---
> > drivers/cpufreq/cpufreq_governor.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
> > index 47e24b5384b3..c9e786e7ee1f 100644
> > --- a/drivers/cpufreq/cpufreq_governor.c
> > +++ b/drivers/cpufreq/cpufreq_governor.c
> > @@ -315,7 +315,7 @@ static void dbs_update_util_handler(struct update_util_data *data, u64 time,
> >
> > policy_dbs->last_sample_time = time;
> > policy_dbs->work_in_progress = true;
> > - irq_work_queue(&policy_dbs->irq_work);
> > + irq_work_queue_on(&policy_dbs->irq_work, data->cpu);
>
> I'm totally unconvinced that this is sufficient.
>
> This function carries out lockless computations with the assumption that it
> will always run on the CPU being updated.
>
> For instance, how is it prevented from being run on two CPUs in parallel in
> the single-CPU policy case if cross-CPU updates are allowed to happen?
I am convinced that it is insufficient and yes I too missed the obvious race
here as well for single cpu per policy. Sorry about that.
> Second, is accessing rq_clock(rq) of a remote runqueue a good idea entirely?
I am not sure about how costly that can be.
--
viresh
next prev parent reply other threads:[~2017-04-11 11:06 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-09 11:45 [RFC 0/9] cpufreq: schedutil: Allow remote wakeups Viresh Kumar
2017-03-09 11:45 ` [RFC 1/9] sched: cpufreq: add cpu to update_util_data Viresh Kumar
2017-03-29 21:18 ` Rafael J. Wysocki
2017-03-09 11:45 ` [RFC 2/9] irq_work: add irq_work_queue_on for !CONFIG_SMP Viresh Kumar
2017-03-29 21:20 ` Rafael J. Wysocki
2017-03-09 11:45 ` [RFC 3/9] cpufreq: Add dvfs_possible_from_any_cpu policy flag Viresh Kumar
2017-03-29 21:22 ` Rafael J. Wysocki
2017-03-09 11:45 ` [RFC 4/9] sched: cpufreq: extend irq work to support fast switches Viresh Kumar
2017-03-29 21:25 ` Rafael J. Wysocki
2017-03-09 11:45 ` [RFC 5/9] sched: cpufreq: remove smp_processor_id() in remote paths Viresh Kumar
2017-03-29 21:28 ` Rafael J. Wysocki
2017-04-11 10:35 ` Viresh Kumar
2017-04-11 14:00 ` Rafael J. Wysocki
2017-04-12 14:26 ` Viresh Kumar
2017-04-12 22:53 ` Rafael J. Wysocki
2017-03-09 11:45 ` [RFC 6/9] sched: cpufreq: detect, process remote callbacks Viresh Kumar
2017-03-29 21:58 ` Rafael J. Wysocki
2017-03-09 11:45 ` [RFC 7/9] cpufreq: governor: support scheduler cpufreq callbacks on remote CPUs Viresh Kumar
2017-03-29 22:14 ` Rafael J. Wysocki
2017-04-11 11:06 ` Viresh Kumar [this message]
2017-03-09 11:45 ` [RFC 8/9] intel_pstate: ignore " Viresh Kumar
2017-03-29 22:15 ` Rafael J. Wysocki
2017-03-09 11:45 ` [RFC 9/9] sched: cpufreq: enable remote sched cpufreq callbacks Viresh Kumar
2017-03-15 11:45 ` [RFC 0/9] cpufreq: schedutil: Allow remote wakeups Rafael J. Wysocki
2017-03-16 3:09 ` Viresh Kumar
2017-03-16 10:04 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170411110605.GD13627@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=Morten.Rasmussen@arm.com \
--cc=eas-dev@lists.linaro.org \
--cc=juri.lelli@arm.com \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=patrick.bellasi@arm.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=smuckle.linux@gmail.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox