lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 23 Sep 2020 17:17:42 +0200
From:   "Rafael J. Wysocki" <rafael@...nel.org>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     Rafael Wysocki <rjw@...ysocki.net>,
        Linux PM <linux-pm@...r.kernel.org>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Lukasz Luba <lukasz.luba@....com>, cristian.marussi@....com,
        Sudeep Holla <sudeep.holla@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2 3/4] cpufreq: stats: Enable stats for fast-switch as well

On Wed, Sep 23, 2020 at 5:14 PM Rafael J. Wysocki <rafael@...nel.org> wrote:
>
> On Wed, Sep 16, 2020 at 8:46 AM Viresh Kumar <viresh.kumar@...aro.org> wrote:
> >
> > Now that all the blockers are gone for enabling stats in fast-switching
> > case, enable it.
> >
> > Signed-off-by: Viresh Kumar <viresh.kumar@...aro.org>
> > ---
> >  drivers/cpufreq/cpufreq.c       | 6 +++++-
> >  drivers/cpufreq/cpufreq_stats.c | 6 ------
> >  2 files changed, 5 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index 47aa90f9a7c2..d5fe64e96be9 100644
> > --- a/drivers/cpufreq/cpufreq.c
> > +++ b/drivers/cpufreq/cpufreq.c
> > @@ -2057,8 +2057,12 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
> >                                         unsigned int target_freq)
> >  {
> >         target_freq = clamp_val(target_freq, policy->min, policy->max);
> > +       target_freq = cpufreq_driver->fast_switch(policy, target_freq);
> >
> > -       return cpufreq_driver->fast_switch(policy, target_freq);
> > +       if (target_freq)
> > +               cpufreq_stats_record_transition(policy, target_freq);
>
> So this adds two extra branches in the scheduler path for the cases
> when the stats are not used at all which seems avoidable to some
> extent.
>
> Can we check policy->stats upfront here and bail out right away if it
> is not set, for example?

Well, scratch this, the next patch fixes it up.

Cheers!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ