From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Steven Barrett Date: Wed, 15 Jan 2020 20:43:56 -0600 Subject: [PATCH] ZEN: intel-pstate: Implement "enable" parameter If intel-pstate is compiled into the kernel, it will preempt the loading of acpi-cpufreq so you can take advantage of hardware p-states without any friction. However, intel-pstate is not completely superior to cpufreq's ondemand for one reason. There's no concept of an up_threshold property. In ondemand, up_threshold essentially reduces the maximum utilization to compare against, allowing you to hit max frequencies and turbo boost from a much lower core utilization. With intel-pstate, you have the concept of minimum and maximum performance, but no tunable that lets you define, maximum frequency means 50% core utilization. For just this oversight, there's reasons you may want ondemand. Lets support setting "enable" in kernel boot parameters. This lets kernel maintainers include "intel_pstate=disable" statically in the static boot parameters, but let users of the kernel override this selection. --- Documentation/admin-guide/kernel-parameters.txt | 3 +++ drivers/cpufreq/intel_pstate.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 3f1cc5e317ed4a5ad001082c9c589b6008f68db9..3b43975427fca63c3403d10003059a482f3b0420 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2026,6 +2026,9 @@ disable Do not enable intel_pstate as the default scaling driver for the supported processors + enable + Enable intel_pstate in-case "disable" was passed + previously in the kernel boot parameters passive Use intel_pstate as a scaling driver, but configure it to work with generic cpufreq governors (instead of diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 846bb3a7878803344bd9b916a046071ff0957620..3eac15cb57c5ecd671713198dda5e28a42282fef 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -3538,6 +3538,8 @@ static int __init intel_pstate_setup(char *str) if (!strcmp(str, "disable")) no_load = 1; + else if (!strcmp(str, "enable")) + no_load = 0; else if (!strcmp(str, "active")) default_driver = &intel_pstate; else if (!strcmp(str, "passive"))