You are not logged in.

#1 2022-12-28 16:35:45

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

TLP not setting EPB

Dear all,

I've found out TLP is not setting the Energy Performance Bias and I need to do that manually, which is of course annoying every time.

More specifically, say at start up or when I restart TLP via systemctl, I find a value of

6

in

sys/devices/system/cpu/cpu*/power/energy_perf_bias

but it ought to be higher. I generally go for 15, which is the highest bias towards Power (0 indicated performance instead).

How can I do that via TLP? Maybe some settings is missing. I'll leave the .conf below. Or, can it be set at boot time in some other way?

https://pastebin.com/wCW7jrwJ

Offline

#2 2022-12-28 18:01:10

radiomike
Member
Registered: 2013-12-19
Posts: 73

Re: TLP not setting EPB

It's probably setting HWP.EPP instead - the default, if available. You can double check that with

 # x86_energy_perf_policy 

Values should change when you dis/connect your AC adaptor

Offline

#3 2022-12-29 10:19:05

linrunner
Member
Registered: 2013-04-21
Posts: 52

Re: TLP not setting EPB

Hi,

no meaningful analysis is possible with the configuration alone. Please show

sudo tlp-stat --cdiff -s -p

Offline

#4 2022-12-29 16:31:59

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

Re: TLP not setting EPB

radiomike wrote:

It's probably setting HWP.EPP instead - the default, if available. You can double check that with

 # x86_energy_perf_policy 

Values should change when you dis/connect your AC adaptor

Yes they do -- from 255 to 192 and indeed EPB is not changed. But they are different settings, aren't they?

Offline

#5 2022-12-29 16:34:03

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

Re: TLP not setting EPB

linrunner wrote:

Hi,

no meaningful analysis is possible with the configuration alone. Please show

sudo tlp-stat --cdiff -s -p

Sure here it is:

---- TLP 1.5.0 --------------------------------------------

+++ Configured Settings (only differences to defaults):
/etc/tlp.conf L0116: CPU_ENERGY_PERF_POLICY_ON_AC="balance_power"
/etc/tlp.conf L0117: CPU_ENERGY_PERF_POLICY_ON_BAT="power"
/etc/tlp.conf L0329: SOUND_POWER_SAVE_ON_AC="0"
/etc/tlp.conf L0439: RESTORE_DEVICE_STATE_ON_STARTUP="1"
/etc/tlp.conf L0514: RESTORE_THRESHOLDS_ON_BAT="1"
/etc/tlp.conf L0044: TLP_DEFAULT_MODE="BAT"
/etc/tlp.conf L0088: CPU_SCALING_GOVERNOR_ON_BAT="powersave"
/etc/tlp.conf L0457: DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth nfc wifi wwan"
/etc/tlp.conf L0479: DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth nfc wifi wwan"
/etc/tlp.conf L0501: START_CHARGE_THRESH_BAT0="75"
/etc/tlp.conf L0502: STOP_CHARGE_THRESH_BAT0="80"
/etc/tlp.conf L0508: START_CHARGE_THRESH_BAT1="75"
/etc/tlp.conf L0509: STOP_CHARGE_THRESH_BAT1="80"

+++ System Info
System         = HUAWEI M1010 BOD-WXX9
BIOS           = 2.29
OS Release     = Arch Linux
Kernel         = 5.18.16-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 03 Aug 2022 11:25:04 +0000 x86_64
/proc/cmdline  = initrd=\initramfs-linux.img root=/dev/nvme0n1p5 rw quiet
Init system    = systemd 
Boot mode      = UEFI

+++ TLP Status
State          = enabled
RDW state      = enabled
Last run       = 17:32:54,      6 sec(s) ago
Mode           = battery
Power source   = battery

+++ Processor
CPU model      = 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz

/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver    = intel_pstate
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor  = powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors = performance powersave
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq  =   400000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq  =  4200000 [kHz]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = power [HWP.EPP]
/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_available_preferences = default performance balance_performance balance_power power 

/sys/devices/system/cpu/cpu1..cpu7: omitted for clarity, use -v to show all

/sys/devices/system/cpu/intel_pstate/status            = active
/sys/devices/system/cpu/intel_pstate/min_perf_pct      =   9 [%]
/sys/devices/system/cpu/intel_pstate/max_perf_pct      = 100 [%]
/sys/devices/system/cpu/intel_pstate/no_turbo          =   0
/sys/devices/system/cpu/intel_pstate/hwp_dynamic_boost =   0
/sys/devices/system/cpu/intel_pstate/turbo_pct         =  47 [%]
/sys/devices/system/cpu/intel_pstate/num_pstates       =  39

/sys/module/workqueue/parameters/power_efficient       = Y
/proc/sys/kernel/nmi_watchdog                          = 0

+++ Platform Profile
/sys/firmware/acpi/platform_profile                    = (not available)
/sys/firmware/acpi/platform_profile_choices            = (not available)

Offline

#6 2022-12-29 17:11:44

linrunner
Member
Registered: 2013-04-21
Posts: 52

Re: TLP not setting EPB

As @radiomike already proposed: your processor supports EPP and thus TLP changes that:

/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = power [HWP.EPP]

The case distinction is somewhat complicated (see Processor Settings), but the bottom line is that EPB is irrelevant on Intel Core i 6th gen. (“Skylake”) or newer CPUs.

Offline

#7 2022-12-29 18:01:27

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

Re: TLP not setting EPB

linrunner wrote:

As @radiomike already proposed: your processor supports EPP and thus TLP changes that:

/sys/devices/system/cpu/cpu0/cpufreq/energy_performance_preference = power [HWP.EPP]

The case distinction is somewhat complicated (see Processor Settings), but the bottom line is that EPB is irrelevant on Intel Core i 6th gen. (“Skylake”) or newer CPUs.

Got it. Would you mind going a bit into the details? (actually I'm an EE so no worries). I guess you're into that from the nickname. They seem very related yet they're different settings (thus to some extent they could also interfere). So let's say, is there any advantage in having both of them set towards Power saving?

As a side note, I should say powertop fails to modprobe cpufreq_stats -- but I guess this is irrelevant if you say EPP is prefered to EBP.

Offline

#8 2022-12-30 09:57:38

linrunner
Member
Registered: 2013-04-21
Posts: 52

Re: TLP not setting EPB

That's a difficult one. When I implemented the logic (way back) in 2019 I perceived the corresponding documentation as quite difficult to penetrate.

It boils down to the CPU ignoring EPB (IA32_HWP_REQUEST MSR) if it has the HWP EPP (IA32_ENERGY_PERF_BIAS MSR) capabilty (in intel_pstate active mode). However, it is not stated directly that the EPP and EPB features are mutually exclusive, you have to infer it indirectly.

intel_pstate: Energy vs Performance Hints states:

Strings written to the energy_performance_preference attribute are internally translated to integer values written to the processor’s Energy-Performance Preference (EPP) knob (if supported) or its Energy-Performance Bias (EPB) knob.

The Intel Software Dev Manual Vol. 3B p. 15-9 states:

15.4.4.1 IA32_HWP_REQUEST MSR (Address: 774H Logical Processor Scope)
[...]
Energy_Performance_Preference (bits 31:24, RW) — Conveys a hint to the HWP hardware. [...] Note: If CPUID.06H:EAX[bit 10] indicates that this field is
not supported, HWP uses the value of the IA32_ENERGY_PERF_BIAS MSR to determine the energy efficiency / performance preference.

If you think about it, it also makes little sense to have two features with the same task in parallel.

Last edited by linrunner (2022-12-30 10:09:00)

Offline

#9 2022-12-30 10:07:29

linrunner
Member
Registered: 2013-04-21
Posts: 52

Re: TLP not setting EPB

The x86_energy_perf_policy manpage bears another hint on the matter:

Hardware  P-States (HWP) are effectively an expansion of hardware P-state control from the
opportunistic turbo-mode P-state range to include the entire range of available  P-states.
On Broadwell Xeon, the initial HWP implementation, EPB influenced HWP.  That influence was
removed in subsequent generations
, where it was moved to the Energy_Performance_Preference
(EPP)    field    in    a   pair   of   dedicated   MSRs   --   MSR_IA32_HWP_REQUEST   and
MSR_IA32_HWP_REQUEST_PKG.

ps. I took the opportunity of your question to clarify the matter in tlp.conf and the docs:

* https://github.com/linrunner/TLP/blob/m … nf.in#L118
* https://linrunner.de/tlp/settings/proce … -on-ac-bat

Last edited by linrunner (2022-12-30 11:10:07)

Offline

#10 2023-01-02 17:15:39

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

Re: TLP not setting EPB

linrunner wrote:

The x86_energy_perf_policy manpage bears another hint on the matter:

Hardware  P-States (HWP) are effectively an expansion of hardware P-state control from the
opportunistic turbo-mode P-state range to include the entire range of available  P-states.
On Broadwell Xeon, the initial HWP implementation, EPB influenced HWP.  That influence was
removed in subsequent generations
, where it was moved to the Energy_Performance_Preference
(EPP)    field    in    a   pair   of   dedicated   MSRs   --   MSR_IA32_HWP_REQUEST   and
MSR_IA32_HWP_REQUEST_PKG.

ps. I took the opportunity of your question to clarify the matter in tlp.conf and the docs:

* https://github.com/linrunner/TLP/blob/m … nf.in#L118
* https://linrunner.de/tlp/settings/proce … -on-ac-bat

Well this one along with the other quote seems convincing. I'm happy to hear maybe it will help somebody else's confusion should they face the same doubt.

So I'm gonna leave the settings as they are and let TLP define EPP.

Thanks a lot. Have a nice year everybody.

Last edited by Grant (2023-01-02 17:16:39)

Offline

Board footer

Powered by FluxBB