From: Giovanni Gherdovich <ggherdovich@suse.cz>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Borislav Petkov <bp@suse.de>, Len Brown <lenb@kernel.org>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>
Cc: x86@kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Mel Gorman <mgorman@techsingularity.net>,
Doug Smythies <dsmythies@telus.net>,
Like Xu <like.xu@linux.intel.com>,
Neil Rickert <nwr10cst-oslnx@yahoo.com>,
Chris Wilson <chris@chris-wilson.co.uk>,
Giovanni Gherdovich <ggherdovich@suse.cz>
Subject: [PATCH 4/4] x86, sched: Move check for CPU type to caller function
Date: Thu, 16 Apr 2020 07:47:45 +0200 [thread overview]
Message-ID: <20200416054745.740-5-ggherdovich@suse.cz> (raw)
In-Reply-To: <20200416054745.740-1-ggherdovich@suse.cz>
Improve readability of the function intel_set_max_freq_ratio() by moving
the check for KNL CPUs there, together with checks for GLM and SKX.
Signed-off-by: Giovanni Gherdovich <ggherdovich@suse.cz>
---
arch/x86/kernel/smpboot.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index dd8e15f648bc..8c89e4d9ad28 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1877,9 +1877,6 @@ static bool knl_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq,
int err, i;
u64 msr;
- if (!x86_match_cpu(has_knl_turbo_ratio_limits))
- return false;
-
err = rdmsrl_safe(MSR_PLATFORM_INFO, base_freq);
if (err)
return false;
@@ -1977,7 +1974,8 @@ static bool intel_set_max_freq_ratio(void)
skx_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
goto out;
- if (knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
+ if (x86_match_cpu(has_knl_turbo_ratio_limits) &&
+ knl_set_max_freq_ratio(&base_freq, &turbo_freq, 1))
goto out;
if (x86_match_cpu(has_skx_turbo_ratio_limits) &&
--
2.16.4
next prev parent reply other threads:[~2020-04-16 5:48 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-16 5:47 [PATCH 0/4] Frequency invariance fixes for x86 Giovanni Gherdovich
2020-04-16 5:47 ` [PATCH 1/4] x86, sched: Bail out of frequency invariance if base frequency is unknown Giovanni Gherdovich
2020-04-16 6:41 ` Giovanni Gherdovich
2020-04-16 15:41 ` Rafael J. Wysocki
2020-04-22 17:15 ` Ricardo Neri
2020-04-23 8:06 ` Giovanni Gherdovich
2020-04-24 1:32 ` Ricardo Neri
2020-04-24 5:53 ` Giovanni Gherdovich
2020-04-22 21:20 ` [tip: sched/urgent] " tip-bot2 for Giovanni Gherdovich
2020-04-16 5:47 ` [PATCH 2/4] x86, sched: Account for CPUs with less than 4 cores in freq. invariance Giovanni Gherdovich
2020-04-16 15:26 ` Dave Kleikamp
2020-04-22 21:20 ` [tip: sched/urgent] " tip-bot2 for Giovanni Gherdovich
2020-04-16 5:47 ` [PATCH 3/4] x86, sched: Don't enable static key when starting secondary CPUs Giovanni Gherdovich
2020-04-22 21:20 ` [tip: sched/urgent] " tip-bot2 for Peter Zijlstra (Intel)
2020-04-16 5:47 ` Giovanni Gherdovich [this message]
2020-04-22 21:20 ` [tip: sched/urgent] x86, sched: Move check for CPU type to caller function tip-bot2 for Giovanni Gherdovich
2020-04-16 7:20 ` [PATCH 0/4] Frequency invariance fixes for x86 Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200416054745.740-5-ggherdovich@suse.cz \
--to=ggherdovich@suse.cz \
--cc=bp@suse.de \
--cc=chris@chris-wilson.co.uk \
--cc=dsmythies@telus.net \
--cc=lenb@kernel.org \
--cc=like.xu@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=mingo@redhat.com \
--cc=nwr10cst-oslnx@yahoo.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).