kernel/cpu power
This is intended as a way to document how to apply cpu power limits to AMD Ryzen CPUs.
power-profiles-daemon
powerprofilesctlShow current statuspowerprofilesctl set power-saverChange mode to power-saverpowerprofilesctl list-actionsList all possible actions and their statuspowerprofilesctl configure-action amdgpu_dpm --enableEnable amdgpu_dpm actionpowerprofilesctl configure-battery-aware --disableDisable dynamic changes on battery status change.
amd_pstate
ls /sys/devices/system/cpu/cpufreq/policy0/*amd*echo 0 > /sys/devices/system/cpu/cpufreq/policy*/boostDisable boostfor i in /sys/devices/system/cpu/cpufreq/policy{0..15}/scaling_max_freq ; do echo 3500000 > $i ; doneSet max freq to 3.5GHzfor i in /sys/devices/system/cpu/cpufreq/policy{0..15}/scaling_min_freq ; do echo 400000 > $i ; doneSet min freq to 400MHzfor i in /sys/devices/system/cpu/cpu{1,3,5,7,8,9,10,11,12,13,14,15}/online; do echo 0 > $i ; donePower off corescat /sys/devices/system/cpu/onlineCheck online coreswhile : ; do : ; donePut load on a single thread.- ``
Manual tunning
- ``
- ``
- ``
- ``
- ``
- ``
Shutting down cores. CPU hotplug
Core 0 can not be shutted down as some architectures may have some special dependency on a certain CPU.
Possible states
Change a target
CPU governor
List governors
Set governor
Interrupts
stats
Meaning:
- user: normal processes executing in user mode
- nice: niced processes executing in user mode
- system: processes executing in kernel mode
- idle: twiddling thumbs
- iowait: In a word, iowait stands for waiting for I/O to complete. But there are several problems:
- Cpu will not wait for I/O to complete, iowait is the time that a task is waiting for I/O to complete. When cpu goes into idle state for outstanding task io, another task will be scheduled on this CPU.
- In a multi-core CPU, the task waiting for I/O to complete is not running on any CPU, so the iowait of each CPU is difficult to calculate.
- The value of iowait field in /proc/stat will decrease in certain conditions. So, the iowait is not reliable by reading from /proc/stat.
- irq: servicing interrupts
- softirq: servicing softirqs
- steal: involuntary wait
- guest: running a normal guest
-
guest_nice: running a niced guest
-
https://www.kernel.org/doc/Documentation/filesystems/proc.txt
tools
powertoppower consumption and power management diagnosis tool.cpupowerShows and sets processor power related values