throttled icon indicating copy to clipboard operation
throttled copied to clipboard

MCHBAR PL1 is not set correctly by Throttled under Debian Bullseye on Lenovo Thinkpad L14 Gen 2

Open fangfufu opened this issue 3 years ago • 0 comments

I am using Debian Bullseye on a Lenovo Thinkpad L14 Gen 2. Throttled is not changing the MCHBAR PL1 settings. This can be confirmed via sysfs:

root@smithsonian:/home/fangfufu# cat /sys/devices/virtual/powercap/intel-rapl-mmio/intel-rapl-mmio:0/constraint_0_power_limit_uw
20000000

I have set it to 60W in /etc/throttled.conf.

I can increase the limit by running the following in the background:

watch -n 1 'echo 60000000 > /sys/devices/virtual/powercap/intel-rapl-mmio/intel-rapl-mmio:0/constraint_0_power_limit_uw'

It would be nice if throttled does this in the background for me.

I am running Debian Bullseye using the kernel from the backport:

fangfufu@smithsonian:~$ uname -a
Linux smithsonian 5.14.0-0.bpo.2-amd64 #1 SMP Debian 5.14.9-2~bpo11+1 (2021-10-10) x86_64 GNU/Linux

I can confirm that throttled is working correctly:

fangfufu@smithsonian:~$ sudo systemctl status throttled
[sudo] password for fangfufu:
● throttled.service - Stop Intel throttling
     Loaded: loaded (/etc/systemd/system/throttled.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2022-01-16 02:10:10 GMT; 33min ago
   Main PID: 115699 (python3)
      Tasks: 2 (limit: 76701)
     Memory: 11.7M
        CPU: 441ms
     CGroup: /system.slice/throttled.service
             └─115699 /opt/throttled/venv/bin/python3 /opt/throttled/throttled.py

Jan 16 02:10:10 smithsonian systemd[1]: Started Stop Intel throttling.
Jan 16 02:10:10 smithsonian python3[115699]: [I] Detected CPU architecture: Intel TigerLake
Jan 16 02:10:10 smithsonian python3[115699]: [I] Trying to unlock MSR allow_writes.
Jan 16 02:10:10 smithsonian python3[115699]: [I] Testing if undervolt is supported...
Jan 16 02:10:10 smithsonian python3[115699]: [I] Testing if HWP is supported...
Jan 16 02:10:10 smithsonian python3[115699]: [I] Loading config file.
Jan 16 02:10:10 smithsonian python3[115699]: [I] Starting main loop.

I set the power properly at /etc/throttled.conf

[GENERAL]
# Enable or disable the script execution
Enabled: True
# SYSFS path for checking if the system is running on AC power
Sysfs_Power_Path: /sys/class/power_supply/AC*/online
# Auto reload config on changes
Autoreload: True

## Settings to apply while connected to Battery power
[BATTERY]
# Update the registers every this many seconds
Update_Rate_s: 30
# Max package power for time window #1
PL1_Tdp_W: 60
# Time window #1 duration
PL1_Duration_s: 28
# Max package power for time window #2
PL2_Tdp_W: 60
# Time window #2 duration
PL2_Duration_S: 0.002
# Max allowed temperature before throttling
Trip_Temp_C: 85
# Set cTDP to normal=0, down=1 or up=2 (EXPERIMENTAL)
cTDP: 0
# Disable BDPROCHOT (EXPERIMENTAL)
Disable_BDPROCHOT: False

## Settings to apply while connected to AC power
[AC]
# Update the registers every this many seconds
Update_Rate_s: 5
# Max package power for time window #1
PL1_Tdp_W: 60
# Time window #1 duration
PL1_Duration_s: 28
# Max package power for time window #2
PL2_Tdp_W: 60
# Time window #2 duration
PL2_Duration_S: 0.002
# Max allowed temperature before throttling
Trip_Temp_C: 95
# Set HWP energy performance hints to 'performance' on high load (EXPERIMENTAL)
# Uncomment only if you really want to use it
# HWP_Mode: False
# Set cTDP to normal=0, down=1 or up=2 (EXPERIMENTAL)
cTDP: 2
# Disable BDPROCHOT (EXPERIMENTAL)
Disable_BDPROCHOT: False

fangfufu avatar Jan 16 '22 02:01 fangfufu