platform: x86: Support Turbo Boost Max for non HWP systems
PATCH 1/1 platform: x86: Support Turbo Boost Max for non HWP systems
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.
--- drivers/platform/x86/Kconfig | 10 ++ drivers/platform/x86/Makefile | 1 + drivers/platform/x86/intel_turbo_boost_max_enum.c | 153 ++++++++++++++++++++++ 3 files changed, 164 insertions(+) create mode 100644 drivers/platform/x86/intel_turbo_boost_max_enum.c
drivers/platform/x86/Kconfig +10 -0
@@ -1076,4 +1076,14 @@ config MLX_CPLD_PLATFORM This driver handles hot-plug events for the power suppliers, power cables and fans on the wide range Mellanox IB and Ethernet systems. +config INTEL_TURBO_BOOST_MAX_ENUMERATION + bool "Intel Turbo Boost Max Technology enumeration driver" + depends on X86_64 && SCHED_MC_PRIO + ---help--- + 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. + This driver is only required when the system is not using Hardware + P-States (HWP). In HWP mode, priority can be read from ACPI tables. + endif # X86_PLATFORM_DEVICES
drivers/platform/x86/Makefile +1 -0
@@ -76,3 +76,4 @@ obj-$(CONFIG_INTEL_TELEMETRY) += intel_telemetry_core.o \ obj-$(CONFIG_INTEL_PMC_CORE) += intel_pmc_core.o obj-$(CONFIG_MLX_PLATFORM) += mlx-platform.o obj-$(CONFIG_MLX_CPLD_PLATFORM) += mlxcpld-hotplug.o +obj-$(CONFIG_INTEL_TURBO_BOOST_MAX_ENUMERATION) += intel_turbo_boost_max_enum.o
drivers/platform/x86/intel_turbo_boost_max_enum.c new file +153 -0
153 lines not on this page · raw message
Signature · 1 line
2.7.4
Quoted 76 lines · Darren Hart
Quoted 21 lines · Srinivas Pandruvada
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.
Quoted 7 lines
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 <[email protected].com>
Thanks Srinivas,
Driver queued to testing with the following changes, but see below...
drivers/platform/x86/intel_turbo_boost_max_enum.c +0
-0@@ -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,drivers/platform/x86/intel_turbo_boost_max_enum.c +0
-0@@ -37,10 +38,8 @@
static intget_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;Quoted 6 lines
---
drivers/platform/x86/Kconfig | 10 ++ drivers/platform/x86/Makefile | 1 +drivers/platform/x86/intel_turbo_boost_max_enum.c| 153
++++++++++++++++++++++
Quoted 7 lines
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.cCONFIG_INTEL_BDW_TURBO
We should add _MAX_3 as this is a technology more than simple TURBO.
CONFIG_INTEL_BDW_TURBO_MAX_3
Quoted 4 lines
I don't think "max enumeration" conveys any meaning to most readers.
Thoughts?
Fine with me with the above comment.
Thanks,
Srinivas
Quoted 16 lines · Srinivas Pandruvada
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.
Quoted 5 lines
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 <[email protected]>
Thanks Srinivas,
Driver queued to testing with the following changes, but see below...
drivers/platform/x86/intel_turbo_boost_max_enum.c +1 -0
@@ -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;Quoted 4 lines
--- 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.cCONFIG_INTEL_BDW_TURBO
I don't think "max enumeration" conveys any meaning to most readers.
Thoughts?
Thanks,
Signature · 2 lines
Darren Hart Intel Open Source Technology Center
Quoted 8 lines · Srinivas Pandruvada
Quoted 4 lines · Darren Hart
On Wed, Jan 11, 2017 at 12:36:34PM -0800, Srinivas Pandruvada wrote:
intel_bdw_turbo.cCONFIG_INTEL_BDW_TURBOWe should add
_MAX_3as this is a technology more than simple TURBO.
CONFIG_INTEL_BDW_TURBO_MAX_3
Would it be re-used in the future?
I would suggest INTEL_TURBO_MAX_3
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 12 lines · Andy Shevchenko
Quoted 10 lines · Srinivas Pandruvada
Quoted 8 lines · Darren Hart
On Wed, Jan 11, 2017 at 12:36:34PM -0800, Srinivas Pandruvada wrote:
intel_bdw_turbo.cCONFIG_INTEL_BDW_TURBO
Quoted 7 lines
Quoted 4 lines
We should add
_MAX_3as this is a technology more than simple TURBO.
CONFIG_INTEL_BDW_TURBO_MAX_3Would it be re-used in the future?
I would suggestINTEL_TURBO_MAX_3
Current direction is to have ACPI CPPC. I am fine dropping BDW. Let me resubmit patch. Anyway my script missed sending emails to all in the maintainer list, so have to resend.
Thanks,
Srinivas