[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200925104612.ge27ptfbqzf3yrql@vireshk-i7>
Date: Fri, 25 Sep 2020 16:16:12 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Lukasz Luba <lukasz.luba@....com>
Cc: Rafael Wysocki <rjw@...ysocki.net>, linux-pm@...r.kernel.org,
Vincent Guittot <vincent.guittot@...aro.org>,
cristian.marussi@....com, sudeep.holla@....com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V2 1/4] cpufreq: stats: Defer stats update to
cpufreq_stats_record_transition()
On 25-09-20, 09:21, Lukasz Luba wrote:
>
>
> On 9/16/20 7:45 AM, Viresh Kumar wrote:
> > In order to prepare for lock-less stats update, add support to defer any
> > updates to it until cpufreq_stats_record_transition() is called.
> >
> > Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> > ---
> > drivers/cpufreq/cpufreq_stats.c | 75 ++++++++++++++++++++++++---------
> > 1 file changed, 56 insertions(+), 19 deletions(-)
> >
>
> [snip]
>
> > @@ -228,10 +264,11 @@ void cpufreq_stats_record_transition(struct cpufreq_policy *policy,
> > struct cpufreq_stats *stats = policy->stats;
> > int old_index, new_index;
> > - if (!stats) {
> > - pr_debug("%s: No stats found\n", __func__);
> > + if (!stats)
> > return;
> > - }
> > +
> > + if (READ_ONCE(stats->reset_pending))
> > + cpufreq_stats_reset_table(stats);
>
> This is in the hot path code, called from the scheduler. I wonder if we
> avoid it or make that branch 'unlikely'?
>
> if (unlikely(READ_ONCE(stats->reset_pending)))
>
> Probably the CPU (when it has good prefetcher) would realize about it,
> but maybe we can help a bit here.
Sure.
--
viresh
Powered by blists - more mailing lists