Linux Power Management development
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Steve Muckle <steve.muckle@linaro.org>,
	Juri Lelli <Juri.Lelli@arm.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: race condition on min/max update?
Date: Fri, 26 Feb 2016 15:11:29 +0100	[thread overview]
Message-ID: <5917491.2o5563OMLE@vostro.rjw.lan> (raw)
In-Reply-To: <20160226025315.GA9159@vireshk-i7>

On Friday, February 26, 2016 08:23:15 AM Viresh Kumar wrote:
> +Rafael and linux-pm list
> 
> On 24-02-16, 12:36, Steve Muckle wrote:
> > Hi Viresh,
> > 
> > A while back you mentioned that it is not required to hold policy->rwsem
> > when calling __cpufreq_driver_target. This simplified things for us a
> > bit in schedfreq.
> > 
> > But if policy->rwsem is not held, how does the frequency transition
> > process protect itself against policy->min or policy->max changing?
> > Don't you have a race there where it'd be possible to end up with the
> > frequency being set to a rate lower than min or higher than max?
> > 
> > I've taken a cursory look through the code and don't see what would
> > prevent this from happening.
> 
> It seems that we were not being consistent with this stuff and might have
> ignored this race altogether. On some cases we do update the frequency with
> policy->rwsem and in others we don't.
> 
> It requires a closer look and cleanup I believe.

A min/max update should trigger ->governor(limits) and then the governor
is responsible for taking care of the race (if it needs to).

At least that's how it should work IMO.

Thanks,
Rafael


  reply	other threads:[~2016-02-26 14:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <56CE1432.2020409@linaro.org>
2016-02-26  2:53 ` race condition on min/max update? Viresh Kumar
2016-02-26 14:11   ` Rafael J. Wysocki [this message]
2016-02-26 14:37     ` Viresh Kumar
2016-02-26 21:05       ` 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=5917491.2o5563OMLE@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=Juri.Lelli@arm.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=steve.muckle@linaro.org \
    --cc=viresh.kumar@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