Modo de energía o escalado de CPU (linux) - Legión GA

Página oficial de Legión GNU/Linux de la comunidad de Telegram

Únete a Telegram

28 jul 2019

Modo de energía o escalado de CPU (linux)




### Modo de escalado del CPU y energía ### 


Para permitir poder controlar el desempeño y la velocidad del cpu se necesita instalar algunas herramientas para que el kernel pueda definir el modo energético para poder funcionar al tope o directamente funcionar en modo energético bajo.
Para poder usar cpupower debemos instalar los siguientes paquetes :


#### lm-sensors , cpufrequtils , cpuset ###


$ sudo apt install cpufrequtils cpuset lm-sensors -y
Una vez instalado necesitaremos instalar la utilidad para el kernel :


$ sudo apt-get install -y linux-tools-$(uname -r)


En el caso que no hayamos instalado la utilidad no dará el siguiente error al correr el comando :


$ sudo cpupower frequency-set --governor userspace


[sudo] contraseña para raika:
WARNING: cpupower not found for kernel 5.1.14-050114


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


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


Ahora si no sabemos qué modos de energía tenemos disponibles ni sabemos la velocidad del cpu podemos ejecutar el comando cpuinfo el cual nos dará los datos :



$ cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
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: 4294.55 ms.
hardware limits: 800 MHz - 1000 MHz
available frequency steps: 1000 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
current policy: frequency should be within 800 MHz and 1000 MHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 1.17 GHz.
cpufreq stats: 1000 MHz:86,80%, 800 MHz:13,20% (27316)
analyzing CPU 1:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 1
CPUs which need to have their frequency coordinated by software: 1
maximum transition latency: 4294.55 ms.
hardware limits: 800 MHz - 1000 MHz
available frequency steps: 1000 MHz, 800 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
current policy: frequency should be within 800 MHz and 1000 MHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 1.19 GHz.
cpufreq stats: 1000 MHz:86,49%, 800 MHz:13,51% (26380)


En mi caso tengo 6 modos de energía los cuales usaremos como referencia:


conservative, ondemand, userspace, powersave, performance, schedutil


### Modo performance ###  


$sudo cpupower frequency-set --governor performance


### Userspace ###  


$ sudo cpupower frequency-set --governor userspace


Para para ver el escalado del cpu que se está usando ejecutaremos esta linea :


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


### Ver la velocidad del cpu ### 


watch -n1 "cat /proc/cpuinfo | grep \"^[c]pu MHz\""























No hay comentarios.:

Publicar un comentario