[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160301125727.GT6357@twins.programming.kicks-ass.net>
Date: Tue, 1 Mar 2016 13:57:27 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Steve Muckle <steve.muckle@...aro.org>,
Ingo Molnar <mingo@...hat.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>,
Morten Rasmussen <morten.rasmussen@....com>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Juri Lelli <Juri.Lelli@....com>,
Patrick Bellasi <patrick.bellasi@....com>,
Michael Turquette <mturquette@...libre.com>,
Ricky Liang <jcliang@...omium.org>
Subject: Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency
selection
On Sat, Feb 27, 2016 at 01:08:02AM +0100, Rafael J. Wysocki wrote:
> @@ -95,18 +98,20 @@ EXPORT_SYMBOL_GPL(cpufreq_set_update_uti
> *
> * This function is called by the scheduler on every invocation of
> * update_load_avg() on the CPU whose utilization is being updated.
> + *
> + * It can only be called from RCU-sched read-side critical sections.
> */
> void cpufreq_update_util(u64 time, unsigned long util, unsigned long max)
> {
> struct update_util_data *data;
>
> - rcu_read_lock();
> -
Maybe, just because I'm paranoid, add something like:
#ifdef CONFIG_LOCKDEP
WARN_ON(debug_locks && !rcu_read_lock_sched_held());
#endif
> data = rcu_dereference(*this_cpu_ptr(&cpufreq_update_util_data));
> - if (data && data->func)
> + /*
> + * If this isn't inside of an RCU-sched read-side critical section, data
> + * may become NULL after the check below.
> + */
> + if (data)
> data->func(data, time, util, max);
> -
> - rcu_read_unlock();
> }
Powered by blists - more mailing lists