пятница, 8 февраля 2019 г.

CPU governor performance

CPU governor performance
Ubuntu 16.04 Desktop performance - setting CPU frequency governor to performance
CPU frequency scaling
Режимы работы процессора. Регулировка.


$ cat /proc/cpuinfo | grep 'model name'
model name      : Intel(R) Pentium(R) CPU G2020 @ 2.90GHz
model name      : Intel(R) Pentium(R) CPU G2020 @ 2.90GHz
user@mtest:~$ cat /proc/cpuinfo | grep MHz
cpu MHz         : 1684.298
cpu MHz         : 2508.526


$ sudo apt install linux-tools-common

$ sudo cpupower frequency-info
WARNING: cpupower not found for kernel 4.15.0-45

  You may need to install the following packages for this specific kernel:
    linux-tools-4.15.0-45-generic
    linux-cloud-tools-4.15.0-45-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic


$ sudo apt install linux-tools-generic linux-cloud-tools-generic
$ sudo apt install linux-tools-4.15.0-45-generic linux-cloud-tools-4.15.0-45-generic


$ sudo cpupower frequency-info
analyzing CPU 0:
  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: 1.60 GHz - 2.90 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 1.60 GHz and 2.90 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 1.64 GHz (asserted by call to kernel)
  boost state support:
    Supported: no
    Active: no
    2900 MHz max turbo 4 active cores
    2900 MHz max turbo 3 active cores
    2900 MHz max turbo 2 active cores
    2900 MHz max turbo 1 active cores

$ sudo cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver
intel_pstate
# SCALING_GOVERNOR="performance"

$ sudo nano /etc/default/grub

#GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable"

Сохранить.
$ sudo update-grub
$ sudo reboot

$ sudo cpupower frequency-info
[sudo] пароль для user:
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: 1.60 GHz - 2.90 GHz
  available frequency steps:  2.90 GHz, 2.80 GHz, 2.70 GHz, 2.60 GHz, 2.50 GHz, 2.40 GHz, 2.30 GHz, 2.20 GHz, 2.10 GHz, 2.00 GHz, 1.90 GHz, 1.80 GHz, 1.70 GHz, 1.60 GHz
  available cpufreq governors: conservative ondemand userspace powersave performance schedutil
  current policy: frequency should be within 1.60 GHz and 2.90 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency: 2.90 GHz (asserted by call to hardware)
  boost state support:
    Supported: no
    Active: no
    2900 MHz max turbo 4 active cores
    2900 MHz max turbo 3 active cores
    2900 MHz max turbo 2 active cores
    2900 MHz max turbo 1 active cores



$ sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
acpi-cpufreq

$ cat /proc/cpuinfo | grep MHz
cpu MHz         : 1656.140
cpu MHz         : 2542.404


$ sudo cpupower frequency-set -g performance
Setting cpu: 0
Setting cpu: 1



$ cat /sys/devices/system/cpu/cpufreq/policy*/bios_limit
2900000
2900000


$ sudo cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_max_freq
2900000
2900000

$ sudo cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_min_freq
2800000
2800000


$ sudo cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
2900000
2900000



# echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
root@mtest:~# echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance
performance


$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

$  sudo cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies
2900000 2800000 2700000 2600000 2500000 2400000 2300000 2200000 2100000 2000000 1900000 1800000 1700000 1600000
2900000 2800000 2700000 2600000 2500000 2400000 2300000 2200000 2100000 2000000 1900000 1800000 1700000 1600000

После неудачи попробовал на другом процессоре:

$ cat /proc/cpuinfo | grep 'model name'
model name      : Intel(R) Pentium(R) CPU G4400 @ 3.30GHz
model name      : Intel(R) Pentium(R) CPU G4400 @ 3.30GHz
$ cat /proc/cpuinfo | grep MHz
cpu MHz         : 799.992
cpu MHz         : 799.992
$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
powersave
powersave


$ sudo apt install linux-tools-common
$ sudo cpupower frequency-info
WARNING: cpupower not found for kernel 4.4.0-97

  You may need to install the following packages for this specific kernel:
    linux-tools-4.4.0-97-generic
    linux-cloud-tools-4.4.0-97-generic

  You may also want to install one of the following packages to keep up to date:
    linux-tools-generic
    linux-cloud-tools-generic
$ sudo apt install linux-tools-generic linux-cloud-tools-generic
$ sudo apt install linux-tools-4.4.0-97-generic linux-cloud-tools-4.4.0-97-generic

Вообщем установить  для ядра 4.4.0-97 не удалось, тогда попробовал вручную:

$ sudo sh -c "echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
$ sudo sh -c "echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor"
$ cat /proc/cpuinfo | grep MHz
cpu MHz         : 3300.128
cpu MHz         : 3300.000

$ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
performance
performance

$ sudo cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
intel_pstate

$ sudo sh -c "echo powersave > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor"
$ sudo sh -c "echo powersave > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor"

$ cat /proc/cpuinfo | grep MHz
cpu MHz         : 799.992
cpu MHz         : 799.992

$ sudo apt remove linux-tools-generic linux-cloud-tools-generic
$ sudo apt remove linux-tools-common




Комментариев нет:

Отправить комментарий