Expand description
CPU Frequency Scaling via MSR for x86_64.
Controls CPU P-states (performance states) through the IA32_PERF_CTL and IA32_PERF_STATUS MSRs. Supports three governors:
- Performance: fixed at maximum frequency
- Powersave: fixed at minimum frequency
- Ondemand: dynamic scaling based on CPU utilization (integer math)
P-state ratios are read from MSR_PLATFORM_INFO (0xCE) which provides the minimum and maximum non-turbo frequency ratios. The bus clock frequency (typically 100 MHz) is used to convert ratios to kHz.
Enums§
- CpuGovernor
- CPU frequency scaling governor.
Functions§
- cpufreq_
available_ governors - Get the list of available governor names.
- cpufreq_
get_ available_ frequencies - Get available CPU frequencies in kHz.
- cpufreq_
get_ frequency - Get the current CPU frequency in kHz.
- cpufreq_
get_ governor - Get the current governor.
- cpufreq_
get_ max_ frequency - Get the maximum frequency in kHz.
- cpufreq_
get_ min_ frequency - Get the minimum frequency in kHz.
- cpufreq_
init - Initialize the CPU frequency scaling subsystem.
- cpufreq_
ondemand_ sample - Sample CPU load and adjust frequency (called periodically).
- cpufreq_
set_ frequency - Set the target CPU frequency in kHz.
- cpufreq_
set_ governor - Set the active CPU frequency governor.
- is_
initialized - Check if cpufreq is initialized.