[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1576787264.8929.10.camel@suse.cz>
Date: Thu, 19 Dec 2019 21:27:44 +0100
From: Giovanni Gherdovich <ggherdovich@...e.cz>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ionela Voinescu <ionela.voinescu@....com>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...e.de>,
Len Brown <lenb@...nel.org>,
"Rafael J . Wysocki" <rjw@...ysocki.net>, x86@...nel.org,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
Mel Gorman <mgorman@...hsingularity.net>,
Matt Fleming <matt@...eblueprint.co.uk>,
Viresh Kumar <viresh.kumar@...aro.org>,
Juri Lelli <juri.lelli@...hat.com>,
Paul Turner <pjt@...gle.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Quentin Perret <qperret@...rret.net>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Doug Smythies <dsmythies@...us.net>
Subject: Re: [PATCH v4 1/6] x86,sched: Add support for frequency invariance
On Wed, 2019-12-18 at 20:34 +0100, Peter Zijlstra wrote:
> On Fri, Dec 06, 2019 at 12:57:46PM +0100, Giovanni Gherdovich wrote:
> > > On Wednesday 13 Nov 2019 at 13:46:49 (+0100), Giovanni Gherdovich wrote:
> > > I see above that you enable the static key (and therefore frequency
> > > invariance before setting the max frequency ratio (if possible) and
> > > before you initialise the counter references. Is there any reason for
> > > doing this?
> > This is a fair point; mine was a deliberate choice but you're the second
> > person making this remark (Peter Zijlstra also suggested I find the max
> > frequency before I set the static key), so it appears this design is
> > unpopular
> > enough to warrant a change in v5.
>
> You actually 'fix' this in the next patch. I thought it was a patch
> management 'fail' that it didn't end up in this patch.
Uhm. I'm not sure I agree; let me paste the function intel_set_cpu_max_freq
after the entire series is applied:
> static void intel_set_cpu_max_freq(void)
> {
> u64 ratio = 1, turbo_ratio = 1;
>
> if (slv_set_cpu_max_freq(&ratio, &turbo_ratio))
> goto set_value;
>
> if (glm_set_cpu_max_freq(&ratio, &turbo_ratio))
> goto set_value;
>
> if (knl_set_cpu_max_freq(&ratio, &turbo_ratio))
> goto set_value;
>
> if (skx_set_cpu_max_freq(&ratio, &turbo_ratio))
> goto set_value;
>
> core_set_cpu_max_freq(&ratio, &turbo_ratio);
>
let's say that all functions return false; as I don't check the return value of
the last one, you can very well end up here with 'ratio' and 'turbo_ratio'
that are still untouched, =1 since their initialization, and I would go on and
set the static key anyway (because I previously checked X86_FEATURE_APERFMPERF).
Right?
> set_value:
> arch_max_turbo_freq = div_u64(turbo_ratio * SCHED_CAPACITY_SCALE,
> ratio);
> set_arch_max_freq(turbo_disabled());
> static_branch_enable(&arch_scale_freq_key);
> }
But again, not only people disagree with this behavior, it's probably a little
misleading too in how it's written. Changing in v5.
Giovanni
Powered by blists - more mailing lists