Skip to content

Commit

Permalink
x86, sched: Move check for CPU type to caller function
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lkml.kernel.org/r/20200416054745.740-5-ggherdovich@suse.cz
  • Loading branch information
Giovanni Gherdovich authored and Peter Zijlstra committed Apr 22, 2020
1 parent b56e7d4 commit db441bd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/x86/kernel/smpboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) &&
Expand Down

0 comments on commit db441bd

Please sign in to comment.