lkml.org 
[lkml]   [2014]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 3/4] PM / OPP: take RCU lock in dev_pm_opp_get_opp_count
Date
On Wednesday, December 17, 2014 10:06:17 AM Viresh Kumar wrote:
> On 17 December 2014 at 04:39, Dmitry Torokhov <dtor@chromium.org> wrote:
> > A lot of callers are missing the fact that dev_pm_opp_get_opp_count
> > needs to be called under RCU lock. Given that RCU locks can safely be
> > nested, instead of providing *_locked() API, let's take RCU lock inside
>
> Hmm, I asked for a *_locked() API because many users of
> dev_pm_opp_get_opp_count() are already calling it from rcu read side
> critical sections.
>
> Now, there are two questions:
> - Can rcu-read side critical sections be nested ?
>
> Yes, this is what the comment over rcu_read_lock() says
>
> * RCU read-side critical sections may be nested. Any deferred actions
> * will be deferred until the outermost RCU read-side critical section
> * completes.
>
> - Would it be better to drop these double rcu_read_locks() ? i.e. either
> get a *_locked() API or fix the callers of dev_pm_opp_get_opp_count().
>
> @Paul: What do you say ?
>

FWIW the change is a stop-gap; I hope we'll get away from using
dev_pm_opp_get_opp_count() in cpufreq drivers and then we can revert the
change. I just did not want to touch cpufreq drivers unless necessary.

Thanks,
Dmitry


\
 
 \ /
  Last update: 2014-12-17 18:41    [W:0.105 / U:1.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site