Обнаружилось после установки ubuntu 20.04 или 24.04, что частота cpu пробивает дно.
Простенький сервер с двумя процессорами intel xeon silver 4210 2.2GHz(10 ядер 20 потоков) который после загрузки оказывается диким тормозом.
turbostate показывает Bzy_MHz 700МГц !
Для всех ядер настройки одинаковые.
# cpupower -c 0 frequency-info
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: Cannot determine or is not supported.
hardware limits: 800 MHz - 3.20 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 1.80 GHz and 3.20 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 700 MHz (asserted by call to kernel)
# ( cd /sys/devices/system/cpu/cpufreq/policy0 && grep . * )
affected_cpus:0
base_frequency:2100000
cpuinfo_max_freq:3200000
cpuinfo_min_freq:800000
cpuinfo_transition_latency:0
energy_performance_available_preferences:default performance balance_performance balance_power power
energy_performance_preference:performance
related_cpus:0
scaling_available_governors:performance powersave
scaling_cur_freq:699997
scaling_driver:intel_pstate
scaling_governor:performance
scaling_max_freq:3200000
scaling_min_freq:1800000
scaling_setspeed:<unsupported>
# ( cd /sys/devices/system/cpu/intel_pstate/ && grep . * )
hwp_dynamic_boost:0
max_perf_pct:100
min_perf_pct:25
no_turbo:0
num_pstates:25
status:active
turbo_pct:45
Поднять частоту можно двумя способами:
1) Загузить половину потоков (stress-ng --cpu 20)
2) выполнить cpupower idle-set -d 1 (запрет P-State С1)
В обоих случаях частота изменяется очень медленно в обе стороны.
от 700MHz до 2700MHz примерно 25-30 секунд и 40-60 секунд назад.
Гугление показало, что я не один такой и проблема именно в настройках убунты.
Почти все треды заканчиваются советом «intel_pstate=disable»
Применение её приводит к использованию acpi-cpufreq, где все работает адекватно: 1 ядро можно раскрутить до 3.19ГГц, а дальше максимальная частота падает.
#
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us
hardware limits: 1000 MHz - 2.20 GHz
available frequency steps: 2.20 GHz, 2.20 GHz, 2.10 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz, 1.50 GHz, 1.40 GHz, 1.30 GHz, 1.20 GHz, 1.10 GHz, 1000 MHz
available cpufreq governors: conservative ondemand userspace powersave performance schedutil
current policy: frequency should be within 1000 MHz and 2.20 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency: 1000 MHz (asserted by call to hardware)
boost state support:
Supported: yes
Active: yes
# turbostat --Summary --quiet --show Busy%,Bzy_MHz,PkgWatt,CoreTmp --interval 3
Busy% Bzy_MHz CoreTmp PkgWatt
0.02 1006 34 23.96
0.01 1000 34 23.78
# stress-ng --cpu 1 &
# turbostat --Summary --quiet --show Busy%,Bzy_MHz,PkgWatt,CoreTmp --interval 3
Busy% Bzy_MHz CoreTmp PkgWatt
2.52 3184 40 57.00
2.52 3178 41 56.97
# stress-ng --cpu 40 &
# turbostat --Summary --quiet --show Busy%,Bzy_MHz,PkgWatt,CoreTmp --interval 3
Busy% Bzy_MHz CoreTmp PkgWatt
100.00 2699 46 140.32
100.00 2699 47 143.71
Аналогичный сервер с Ubuntu 18.04.6 LTS и с intel_ptate в простое показывает 2.7GHz & 33Watt
# turbostat --Summary --quiet --show Busy%,Bzy_MHz,PkgWatt,PkgTmp --interval 3
Busy% Bzy_MHz PkgTmp PkgWatt
0.76 2697 41 33.61
0.46 2698 41 32.99
# cpupower -c 30 frequency-info
analyzing CPU 30:
driver: intel_pstate
CPUs which run at the same hardware frequency: 30
CPUs which need to have their frequency coordinated by software: 30
maximum transition latency: Cannot determine or is not supported.
hardware limits: 800 MHz - 3.20 GHz
available cpufreq governors: performance powersave
current policy: frequency should be within 1.20 GHz and 3.20 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency: Unable to call hardware
current CPU frequency: 2.70 GHz (asserted by call to kernel)
boost state support:
Supported: yes
Active: yes
Вопрос: может есть способ настроить адекватно intel_pstate?
Или ну его нафиг, если acpi-cpufreq работает?