[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160203060554.GS31828@vireshk>
Date: Wed, 3 Feb 2016 11:35:54 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Juri Lelli <juri.lelli@....com>
Cc: Rafael Wysocki <rjw@...ysocki.net>, linaro-kernel@...ts.linaro.org,
linux-pm@...r.kernel.org, skannan@...eaurora.org,
peterz@...radead.org, mturquette@...libre.com,
steve.muckle@...aro.org, vincent.guittot@...aro.org,
morten.rasmussen@....com, dietmar.eggemann@....com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 5/5] cpufreq: Get rid of ->governor_enabled and its lock
On 02-02-16, 16:49, Juri Lelli wrote:
> There are still paths where we call __cpufreq_governor() without holding
> policy->rwsem, but those should be fixed with my cleanups (that I intend
> to refresh and post soon). So, I'm not sure we can safely remove this
> yet.
No, we can't.. Though I haven't seen any races from happening even
after removing it, but it doesn't mean we can't.
The deal is that, the entire sequence of events needs to be guaranteed
to happen in a particular order without any other code performing
similar operations concurrently.
And so we need to preserve the other sites with proper rwsem locking
first.
> So, __cpufreq_governor() becomes effectively a wrapper around
> ->governor() calls and governors are left responsible for implementing
> the state machine with appropriate checks.
Not really. The core can now guarantee that the entire sequence
happens atomically. For example, on governor switch, we need to
guarantee that STOP/EXIT happen without any intervention for the old
governor. Or, INIT/START/LIMITS happen without any intervention for
the new governor, etc..
> Maybe we add a comment somewhere stating exactly how things are meant to
> work?
Hmm.
--
viresh
Powered by blists - more mailing lists