Re: [PATCH] platform: x86: Support Turbo Boost Max for non HWP systems
From: Srinivas Pandruvada
Date: Tue Jan 17 2017 - 19:39:26 EST
On Tue, 2017-01-17 at 16:32 -0800, Darren Hart wrote:
> On Wed, Jan 11, 2017 at 12:36:34PM -0800, Srinivas Pandruvada wrote:
> >
> > On platforms supporting Intel Turbo Boost Max Technology 3.0, the
> > maximum turbo frequencies (turbo ratio) of some cores in a CPU
> > package
> > may be higher than the other cores in the same package.ÂÂIn that
> > case,
> > better performance can be achieved by making the scheduler prefer
> > to run
> > tasks on the CPUs with higher max turbo frequencies.
> >
> > On Intel Broadwell Xeon systems, it is optional to turn on HWP
> > (Hardware P-States). When HWP is not turned on, the BIOS doesn't
> > present required CPPC (Collaborative Processor Performance Control)
> > tables. This table is used to get the per CPU core maximum
> > performance
> > ratio and inform scheduler (in cpufreq/intel_pstate driver).
> >
> > On such systems the maximum performance ratio can be read via over
> > clocking (OC) mailbox interface for each CPU. This interface is not
> > architectural and can change for every model of processors.
> >
> > This driver reads maximum performance ratio of each CPU and set up
> > the scheduler priority metrics. In this way scheduler can prefer
> > CPU
> > with higher performance to schedule tasks.
> >
> > Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@xxxxxxxxxxx
> > .com>
>
> Thanks Srinivas,
>
> Driver queued to testing with the following changes, but see below...
>
> diff --git a/drivers/platform/x86/intel_turbo_boost_max_enum.c
> b/drivers/platform/x86/intel_turbo_boost_max_enum.c
> index 5ad3257..5df43c9 100644
> --- a/drivers/platform/x86/intel_turbo_boost_max_enum.c
> +++ b/drivers/platform/x86/intel_turbo_boost_max_enum.c
> @@ -1,6 +1,7 @@
> Â/*
> Â * Intel Turbo Boost Max Technology 3.0 legacy (non HWP) enumeration
> driver
> Â * Copyright (c) 2017, Intel Corporation.
> + * All rights reserved.
>
> This is the preferred format last time I asked Intel legal.
>
> Â *
> Â * This program is free software; you can redistribute it and/or
> modify it
> Â * under the terms and conditions of the GNU General Public License,
> @@ -37,10 +38,8 @@
> Â
> Âstatic int get_oc_core_priority(unsigned int cpu)
> Â{
> -ÂÂÂÂÂÂÂu64 value;
> -ÂÂÂÂÂÂÂu64 cmd = OC_MAILBOX_FC_CONTROL_CMD;
> -ÂÂÂÂÂÂÂint i;
> -ÂÂÂÂÂÂÂint ret;
> +ÂÂÂÂÂÂÂu64 value, cmd = OC_MAILBOX_FC_CONTROL_CMD;
> +ÂÂÂÂÂÂÂint ret, i;
> Â
> Subjective, but we prefer to save the lines.
>
> ÂÂÂÂÂÂÂÂ/* Issue favored core read command */
> ÂÂÂÂÂÂÂÂvalue = cmd << MSR_OC_MAILBOX_CMD_OFFSET;
>
>
> >
> > ---
> > Âdrivers/platform/x86/KconfigÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ10 ++
> > Âdrivers/platform/x86/MakefileÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> > Âdrivers/platform/x86/intel_turbo_boost_max_enum.c | 153
> > ++++++++++++++++++++++
>
> Regarding the name, two nits:
>
> 1) It's soooooooooooooooo long..... and the CONFIG_* too.
> 2) Since it is BDW specifc, how about:
>
> intel_bdw_turbo.c
> CONFIG_INTEL_BDW_TURBO
We should add _MAX_3 as this is a technology more than simple TURBO.
CONFIG_INTEL_BDW_TURBO_MAX_3
>
> I don't think "max enumeration" conveys any meaning to most readers.
>
> Thoughts?
Fine with me with the above comment.
Thanks,
Srinivas