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:   Tue, 24 Sep 2019 16:03:32 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Giovanni Gherdovich <ggherdovich@...e.cz>
Cc:     Quentin Perret <qperret@...rret.net>,
        srinivas.pandruvada@...ux.intel.com, tglx@...utronix.de,
        mingo@...hat.com, bp@...e.de, lenb@...nel.org, rjw@...ysocki.net,
        x86@...nel.org, linux-pm@...r.kernel.org,
        linux-kernel@...r.kernel.org, mgorman@...hsingularity.net,
        matt@...eblueprint.co.uk, viresh.kumar@...aro.org,
        juri.lelli@...hat.com, pjt@...gle.com, vincent.guittot@...aro.org,
        dietmar.eggemann@....com
Subject: Re: [PATCH 1/2] x86,sched: Add support for frequency invariance

On Tue, Sep 17, 2019 at 04:27:46PM +0200, Giovanni Gherdovich wrote:
> Hello Quentin,
> 
> On Sat, 2019-09-14 at 12:57 +0200, Quentin Perret wrote:
> > Hi Giovanni
> > 
> > On Monday 09 Sep 2019 at 04:42:15 (+0200), Giovanni Gherdovich wrote:
> > > +static inline long arch_scale_freq_capacity(int cpu)
> > > +{
> > > +	if (static_cpu_has(X86_FEATURE_APERFMPERF))
> > > +		return per_cpu(arch_cpu_freq, cpu);
> > 
> > So, if this is conditional, perhaps you could also add this check in an
> > x86-specific implementation of arch_scale_freq_invariant() ? That would
> > guide sugov in the right path (see get_next_freq()) if APERF/MPERF are
> > unavailable.
> > 
> > > +	return 1024 /* SCHED_CAPACITY_SCALE */;
> > > +}
> >
> 
> Good remark. If the cpu doesn't have APERF/MPERF, the choice here is that
> freq_curr is constantly equal to freq_max, and the scaling factor is 1 all the
> time.
> 
> But I'm checking this static_cpu_has() every time I do a frequency update;
> arguably schedutil should be smarter and settle such a case once and for all
> at boot time.
> 
> I'll check what's the cost of static_cpu_has() and if it's non-negligible I'll
> do what you suggest (x86-specific version of arch_scale_freq_invariant().

static_cpu_has() is an alternative and ends up being a static branch
(similar to static_key) once the alternative patching runs.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ