linux/drivers/cpufreq
Srinivas Pandruvada 3be9200d51 cpufreq: intel_pstate: Adjust policy->max
When policy->max is changed via _PPC or sysfs and is more than the max non
turbo frequency, it does not really change resulting performance in some
processors. When policy->max results in a P-State ratio more than the
turbo activation ratio, then processor can choose any P-State up to max
turbo. So the user or _PPC setting has no value, but this can cause
undesirable side effects like:
- Showing reduced max percentage in Intel P-State sysfs
- It can cause reduced max performance under certain boundary conditions:
The requested max scaling frequency either via _PPC or via cpufreq-sysfs,
will be converted into a fixed floating point max percent scale. In
majority of the cases this will result in correct max. But not 100% of the
time. If the _PPC is requested at a point where the calculation lead to a
lower max, this can result in a lower P-State then expected and it will
impact performance.
Example of this condition using a Broadwell laptop with config TDP.

ACPI _PSS table from a Broadwell laptop
2301000 2300000 2200000 2000000 1900000 1800000 1700000 1500000 1400000
1300000 1100000 1000000 900000 800000 600000 500000

The actual results by disabling config TDP so that we can get what is
requested on or below 2300000Khz.

scaling_max_freq        Max Requested P-State   Resultant scaling
max
---------------------------------------- ----------------------
2400000                 18                      2900000 (max
turbo)
2300000                 17                      2300000 (max
physical non turbo)
2200000                 15                      2100000
2100000                 15                      2100000
2000000                 13                      1900000
1900000                 13                      1900000
1800000                 12                      1800000
1700000                 11                      1700000
1600000                 10                      1600000
1500000                 f                       1500000
1400000                 e                       1400000
1300000                 d                       1300000
1200000                 c                       1200000
1100000                 a                       1000000
1000000                 a                       1000000
900000                  9                        900000
800000                  8                        800000
700000                  7                        700000
600000                  6                        600000
500000                  5                        500000
------------------------------------------------------------------

Now set the config TDP level 1 ratio as 0x0b (equivalent to 1100000KHz)
in BIOS (not every system will let you adjust this).
The turbo activation ratio will be set to one less than that, which will
be 0x0a (So any request above 1000000KHz should result in turbo region
assuming no thermal limits).
Here _PPC will request max to 1100000KHz (which basically should still
result in turbo as this is more than the turbo activation ratio up to
max allowable turbo frequency), but actual calculation resulted in a max
ceiling P-State which is 0x0a. So under any load condition, this driver
will not request turbo P-States. This will be a huge performance hit.

When config TDP feature is ON, if the _PPC points to a frequency above
turbo activation ratio, the performance can still reach max turbo. In this
case we don't need to treat this as the reduced frequency in set_policy
callback.

In this change when config TDP is active (by checking if the physical max
non turbo ratio is more than the current max non turbo ratio), any request
above current max non turbo is treated as full performance.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ rjw : Minor cleanups ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2016-04-28 01:01:39 +02:00
..
acpi-cpufreq.c cpufreq: ACPI: Remove freq_table from acpi_cpufreq_data 2016-04-09 01:54:31 +02:00
amd_freq_sensitivity.c cpufreq: governor: Make governor private data per-policy 2016-03-09 14:41:08 +01:00
arm_big_little.c cpufreq: arm_big_little: Add support to register a cpufreq cooling device 2015-12-10 00:14:58 +01:00
arm_big_little.h PM / OPP: Prefix exported opp routines with dev_pm_opp_ 2015-09-15 02:03:16 +02:00
arm_big_little_dt.c PM / OPP: Prefix exported opp routines with dev_pm_opp_ 2015-09-15 02:03:16 +02:00
at32ap-cpufreq.c cpufreq: at32ap: don't declare local variable as static 2014-04-07 14:31:33 +02:00
blackfin-cpufreq.c blackfin-cpufreq: Mark cpu_set_cclk() as static 2015-12-28 01:51:36 +01:00
cppc_cpufreq.c cpufreq: ACPI / CPPC: Add module support for cppc_cpufreq driver 2016-04-25 15:59:35 +02:00
cpufreq-dt-platdev.c cpufreq: hisilicon: Use generic platdev driver 2016-04-25 16:18:24 +02:00
cpufreq-dt.c cpufreq: dt: Drop stale comment 2016-04-05 03:40:44 +02:00
cpufreq-nforce2.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
cpufreq.c Merge back cpufreq changes for v4.7. 2016-04-25 15:44:01 +02:00
cpufreq_conservative.c cpufreq: governor: New data type for management part of dbs_data 2016-04-02 01:09:00 +02:00
cpufreq_governor.c cpufreq: governor: Fix prev_load initialization in cpufreq_governor_start() 2016-04-25 16:21:34 +02:00
cpufreq_governor.h cpufreq: Move governor symbols to cpufreq.h 2016-04-02 01:09:02 +02:00
cpufreq_governor_attr_set.c cpufreq: governor: Move abstract gov_attr_set code to seperate file 2016-04-02 01:09:01 +02:00
cpufreq_ondemand.c cpufreq: governor: New data type for management part of dbs_data 2016-04-02 01:09:00 +02:00
cpufreq_ondemand.h cpufreq: governor: Relocate definitions of tuners structures 2016-03-09 14:41:09 +01:00
cpufreq_performance.c cpufreq: Clean up default and fallback governor setup 2016-02-05 02:37:42 +01:00
cpufreq_powersave.c cpufreq: Clean up default and fallback governor setup 2016-02-05 02:37:42 +01:00
cpufreq_stats.c cpufreq: stats: drop unnecessary locking 2015-01-23 23:06:45 +01:00
cpufreq_userspace.c cpufreq: Clean up default and fallback governor setup 2016-02-05 02:37:42 +01:00
cris-artpec3-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
cris-etraxfs-cpufreq.c cpufreq: create another field .flags in cpufreq_frequency_table 2014-04-07 14:43:50 +02:00
davinci-cpufreq.c cpufreq: drop owner assignment from platform_drivers 2014-10-20 16:20:24 +02:00
dbx500-cpufreq.c cpufreq: drop owner assignment from platform_drivers 2014-10-20 16:20:24 +02:00
e_powersaver.c cpufreq: e_powersaver: Use IS_ENABLED() instead of checking for built-in or module 2016-04-27 22:42:34 +02:00
elanfreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
exynos5440-cpufreq.c PM / OPP: Prefix exported opp routines with dev_pm_opp_ 2015-09-15 02:03:16 +02:00
freq_table.c cpufreq: Allow drivers to enable boost support after registering driver 2015-08-07 03:25:23 +02:00
gx-suspmod.c cpufreq: gx-suspmod: Fix two typos in two comments 2015-06-15 15:46:15 +02:00
highbank-cpufreq.c Merge branch 'mailbox-for-linus' of git://git.linaro.org/landing-teams/working/fujitsu/integration 2014-10-21 11:21:19 -07:00
ia64-acpi-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
imx6q-cpufreq.c Merge branch 'pm-opp' 2015-11-02 00:54:37 +01:00
integrator-cpufreq.c cpufreq: integrator: Fix module autoload for OF platform driver 2015-09-25 23:29:35 +02:00
intel_pstate.c cpufreq: intel_pstate: Adjust policy->max 2016-04-28 01:01:39 +02:00
Kconfig cpufreq: dt: Add generic platform-device creation support 2016-04-09 01:18:42 +02:00
Kconfig.arm cpufreq: hisilicon: Use generic platdev driver 2016-04-25 16:18:24 +02:00
Kconfig.powerpc cpufreq: qoriq: rename the driver 2015-03-18 22:35:16 +01:00
Kconfig.x86 cpufreq: intel_pstate: Enforce _PPC limits 2016-04-28 01:01:39 +02:00
kirkwood-cpufreq.c cpufreq: drop owner assignment from platform_drivers 2014-10-20 16:20:24 +02:00
longhaul.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
longhaul.h cpufreq: delete __cpuinit usage from all cpufreq files 2013-07-14 19:36:57 -04:00
longrun.c cpufreq: add new routine cpufreq_verify_within_cpu_limits() 2013-10-16 00:50:23 +02:00
loongson2_cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
ls1x-cpufreq.c MIPS: Loongson: Naming style cleanup and rework 2015-06-21 21:53:59 +02:00
Makefile cpufreq: hisilicon: Use generic platdev driver 2016-04-25 16:18:24 +02:00
maple-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
mt8173-cpufreq.c cpufreq: mt8173: use list_for_each_entry*() 2016-04-09 01:27:54 +02:00
omap-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
p4-clockmod.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
pasemi-cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
pcc-cpufreq.c cpufreq: pcc-cpufreq: update default value of cpuinfo_transition_latency 2015-12-10 00:17:03 +01:00
pmac32-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
pmac64-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
powernow-k6.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
powernow-k7.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
powernow-k7.h
powernow-k8.c ACPI / processor: Drop an unused argument of a cleanup routine 2015-07-22 22:11:16 +02:00
powernow-k8.h cpufreq: powernow-k8: Suppress checkpatch warnings 2014-05-17 01:27:01 +02:00
powernv-cpufreq.c cpufreq: powernv: Ramp-down global pstate slower than local-pstate 2016-04-27 23:56:58 +02:00
ppc_cbe_cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
ppc_cbe_cpufreq.h cpufreq: e_powersaver: Use IS_ENABLED() instead of checking for built-in or module 2016-04-27 22:42:34 +02:00
ppc_cbe_cpufreq_pervasive.c cpufreq: powerpc/platforms/cell: move cpufreq driver to drivers/cpufreq 2013-04-10 13:19:26 +02:00
ppc_cbe_cpufreq_pmi.c cpufreq: ppc_cbe_cpufreq_pmi: make the driver explicitly non-modular 2016-04-09 01:11:04 +02:00
pxa2xx-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
pxa3xx-cpufreq.c cpufreq: Remove cpufreq_generic_exit() 2014-03-12 01:06:00 +01:00
qoriq-cpufreq.c cpufreq: qoriq: Fix cooling device registration issue during suspend 2016-04-25 16:07:02 +02:00
s3c24xx-cpufreq-debugfs.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
s3c24xx-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
s3c64xx-cpufreq.c cpufreq: Use cpufreq_for_each_* macros for frequency table iteration 2014-04-30 00:06:21 +02:00
s3c2410-cpufreq.c cpufreq: s3c24xx: Remove some dead code 2014-07-19 04:24:59 +09:00
s3c2412-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
s3c2416-cpufreq.c cpufreq: s3c: remove incorrect __init annotations 2015-02-19 06:36:53 +01:00
s3c2440-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
s5pv210-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
sa1100-cpufreq.c cpufreq: Mark ARM drivers with CPUFREQ_NEED_INITIAL_FREQ_CHECK flag 2014-01-06 14:17:25 +01:00
sa1110-cpufreq.c cpufreq: sa1110: set memory type for h3600 2014-07-16 14:30:17 +02:00
sc520_freq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
scpi-cpufreq.c cpufreq: scpi-cpufreq: signedness bug in scpi_get_dvfs_info() 2015-12-24 02:11:37 +01:00
sfi-cpufreq.c cpufreq: sfi: use kmemdup rather than duplicating its implementation 2015-09-01 15:51:15 +02:00
sh-cpufreq.c cpufreq: Convert existing drivers to use cpufreq_freq_transition_{begin|end} 2014-03-26 16:41:41 +01:00
sparc-us2e-cpufreq.c cpufreq: add 'freq_table' in struct cpufreq_policy 2014-03-12 01:06:00 +01:00
sparc-us3-cpufreq.c cpufreq: add 'freq_table' in struct cpufreq_policy 2014-03-12 01:06:00 +01:00
spear-cpufreq.c cpufreq: drop owner assignment from platform_drivers 2014-10-20 16:20:24 +02:00
speedstep-centrino.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
speedstep-ich.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
speedstep-lib.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
speedstep-lib.h
speedstep-smi.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
sti-cpufreq.c cpufreq: st: Provide runtime initialised driver for ST's platforms 2015-12-12 02:55:21 +01:00
tegra20-cpufreq.c cpufreq: tegra20: remove superfluous CONFIG_PM ifdefs 2015-09-26 03:00:57 +02:00
tegra124-cpufreq.c cpufreq: tegra124: No need of setting platform-data 2016-04-09 01:12:09 +02:00
unicore2-cpufreq.c cpufreq: unicore32: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO 2014-04-21 23:42:27 +02:00
vexpress-spc-cpufreq.c cpufreq: drop owner assignment from platform_drivers 2014-10-20 16:20:24 +02:00