## 探索背景

1. 支持的P-state范围，以及是否支持Hardware P-state (hwp)

2. 内核的启动参数，对intel cpu一般是intel_pstate=active|passive|no_hwp|......

3. 服务器BIOS设置：是否进行了”硬件频率控制“等设置

## P-state相关介绍

### 软件

#### With Turbo

1. intel_pstate with active mode

该模式下通过MSR-EPP/EPB寄存器控制频率调度的偏好。支持两种策略

• performance: intel_pstate will write 0 to the processor’s Energy-Performance Preference (EPP) knob (if supported) or its Energy-Performance Bias (EPB) knob (otherwise). This will override the EPP/EPB setting coming from the sysfs interface

注意，该模式并非总是进入允许的最高P-state，而是激进地提升P状态。

• powersave: intel_pstate will set the processor’s Energy-Performance Preference (EPP) knob (if supported) or its EnergyPerformance Bias (EPB) knob (otherwise) to whatever value it was previously set to via sysfs (or whatever default value it was set to by the platform firmware). This usually causes the processor’s internal P-state selection logic to be less performance-focused.

2. intel_pstate with no_hwp mode

该模式是不支持HWP功能CPU的默认模式，也是添加了intel_pstate=no_hwp内核启动参数的模式（不一定生效，在实验中如果BIOS开启了HWP，该参数无法对调度产生影响）。支持两种策略

• performance: It selects the maximum P-state it is allowed to use, subject to limits set via sysfs, every time the P-state selection computations are carried out by the driver’s utilization update callback for the given CPU (that does not happen more often than every 10 ms), but the hardware configuration will not be changed if the new P-state is the same as the current one.

• powersave: It generally selects P-states proportional to the current CPU utilization, so it is referred to as the “proportional” algorithm

3. intel_pstate with passive mode

该模式隐式声明了no_hwp参数，并被称为intel_cpufreq

• The driver behaves like a regular CPUFreq scaling driver. That is, it is invoked by generic scaling governors when necessary to talk to the hardware in order to change the P-state of a CPU (in particular, the schedutil governor can invoke it directly from scheduler context).

• While in this mode, intel_pstate can be used with all of the (generic) scaling governors listed by the scaling_available_governors policy attribute in sysfs (and the P-state selection algorithms described above are not used).

• In other words, in the passive mode the entire range of available P-states is exposed by intel_pstate to the CPUFreq core. However, in this mode the driver does not register utilization update callbacks with the CPU scheduler and the scaling_cur_freq information comes from the CPUFreq core (and is the last frequency selected by the current scaling governor for the given policy).

4. intel_pstate with per_cpu_perf_limits mode

该模式屏蔽max_perf_pctmin_perf_pct这两个全局限制。

#### Without Turbo

1. intel_pstate with disable parameter (usually acpi-cpufreq)

不使用 intel_pstate 即使处理器支持。 实际上此时linux系统会选择acpi-cpufreq调度器。

• Apart from the above, acpi-cpufreq works like intel_pstate in the passive mode, except that the number of P-states it can set is limited to the ones listed by the ACPI _PSS objects.

实质上，此时CPU不支持睿频

## 发送评论编辑评论

|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
（╯‵□′）╯︵┴─┴
￣﹃￣
(/ω＼)
∠( ᐛ 」∠)＿
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ｀)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ(￣∇￣o)
ヾ(´･ ･｀｡)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò｡)
Σ(っ °Д °;)っ
( ,,´･ω･)ﾉ"(´っω･｀｡)
╮(╯▽╰)╭
o(*////▽////*)q
＞﹏＜
( ๑´•ω•) "(ㆆᴗㆆ)

Emoji