Skip to contentSkip to conversation

Intel Uncore frequency control

PATCH New Srinivas Pandruvada 1 participant 3 messages Jan 13, 2020 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

v3 cover Intel Uncore frequency control

v3:
Chen Yu pointed issue with rdmsrl, to change to rdmsrl_on_cpu

v2:
Split the documentation patch to another patch to merge via different tree
Add MAINTAINER entry

Srinivas Pandruvada (2):
platform/x86: Add support for Uncore frequency control
MAINTAINERS: Update for the intel uncore frequency control

 MAINTAINERS                                   |   6 +
 drivers/platform/x86/Kconfig                  |  11 +
 drivers/platform/x86/Makefile                 |   1 +
 drivers/platform/x86/intel-uncore-frequency.c | 437 ++++++++++++++++++
 4 files changed, 455 insertions(+)
 create mode 100644 drivers/platform/x86/intel-uncore-frequency.c
Signature · 1 line
2.24.1
#1 lore raw

PATCH v3 1/2 platform/x86: Add support for Uncore frequency control

Some server users set limits on the uncore frequency using MSR 620H, while running latency sensitive workloads. Here uncore frequency controls RING/LLC(last-level cache) clocks.

But MSR control is not always possible from the user space, so this driver provides a sysfs interface to set max and min frequency limits. This MSR 620H is a die scoped in multi-die system or package scoped in non multi-die systems.

When this driver is loaded, a new directory is created under
/sys/devices/system/cpu.

For example on a two package Skylake server:
$cd /sys/devices/system/cpu/intel_uncore_frequency

$ls
package_00_die_00 package_01_die_00

$ls package_00_die_00
max_freq_khz min_freq_khz initial_max_freq_khz
initial_min_freq_khz

$grep . *

    max_freq_khz:2400000
    min_freq_khz:1200000
    initial_max_freq_khz:2400000
    initial_min_freq_khz:1200000

Here, initial_max_freq_khz and initial_min_freq_khz are read only attributes to show power up or initial values of max and min frequencies respectively. Other attributes are read-write, so that users can modify.

---
 drivers/platform/x86/Kconfig                  |  11 +
 drivers/platform/x86/Makefile                 |   1 +
 drivers/platform/x86/intel-uncore-frequency.c | 437 ++++++++++++++++++
 3 files changed, 449 insertions(+)
 create mode 100644 drivers/platform/x86/intel-uncore-frequency.c
drivers/platform/x86/Kconfig +11 -0
index 27d5b40fb717..6013c3b96cfd 100644
@@ -1337,6 +1337,17 @@ config PCENGINES_APU2
 	  To compile this driver as a module, choose M here: the module
 	  will be called pcengines-apuv2.
 
+config INTEL_UNCORE_FREQ_CONTROL
+	tristate "Intel Uncore frequency control driver"
+	depends on X86_64
+	help
+	  This driver allows control of uncore frequency limits on
+	  supported server platforms.
+	  Uncore frequency controls RING/LLC (last-level cache) clocks.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called intel-uncore-frequency.
+
 source "drivers/platform/x86/intel_speed_select_if/Kconfig"
 
 config SYSTEM76_ACPI
drivers/platform/x86/Makefile +1 -0
index 42d85a00be4e..3747b1f07cf1 100644
@@ -105,3 +105,4 @@ obj-$(CONFIG_INTEL_ATOMISP2_PM)	+= intel_atomisp2_pm.o
 obj-$(CONFIG_PCENGINES_APU2)	+= pcengines-apuv2.o
 obj-$(CONFIG_INTEL_SPEED_SELECT_INTERFACE) += intel_speed_select_if/
 obj-$(CONFIG_SYSTEM76_ACPI)	+= system76_acpi.o
+obj-$(CONFIG_INTEL_UNCORE_FREQ_CONTROL)	+= intel-uncore-frequency.o
drivers/platform/x86/intel-uncore-frequency.c new file +437 -0

437 lines not on this page · raw message

Signature · 1 line
2.24.1
#2 lore raw

PATCH v3 2/2 MAINTAINERS: Update for the intel uncore frequency control

In reply to Srinivas Pandruvada

Add an entry for drivers/platform/x86/intel-uncore-frequency.c.

---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
index 4017e6b760be..dbdadb369082 100644
@@ -8562,6 +8562,12 @@ S:	Maintained
 F:	arch/x86/include/asm/intel_telemetry.h
 F:	drivers/platform/x86/intel_telemetry*
 
+INTEL UNCORE FREQUENCY CONTROL
+M:	Srinivas Pandruvada <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/platform/x86/intel-uncore-frequency.c
+
 INTEL VIRTUAL BUTTON DRIVER
 M:	AceLan Kao <[email protected]>
 L:	[email protected]
Signature · 1 line
2.24.1