Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
odroid-xu4:application_note:software:cpufrequtils_cpufreq_govornor [2019/04/19 10:00]
joy.cho [Cpufrequtils]
odroid-xu4:application_note:software:cpufrequtils_cpufreq_govornor [2019/04/19 10:34] (current)
odroid [Cpufrequtils]
Line 3: Line 3:
 Dynamic CPU frequency scaling (also known as CPU throttling) is a technique in computer architecture where a processor is run at a less-than-maximum frequency in order to conserve power. Dynamic CPU frequency scaling (also known as CPU throttling) is a technique in computer architecture where a processor is run at a less-than-maximum frequency in order to conserve power.
  
-Setup process ​is as following.+ 
 +Here is a setup process using "​cpufrequtils"​.
  
 === 1. Install "​cpufrequtils"​ === === 1. Install "​cpufrequtils"​ ===
Line 37: Line 38:
 Then, you can check the cpufreq info is updated. Then, you can check the cpufreq info is updated.
 <code bash target> <code bash target>
-sudo cpufreq-info -o+$ cpufreq-info -o
           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor
 CPU  0       ​100000 kHz (  6 %)  -    1536000 kHz (100 %)  -  ondemand CPU  0       ​100000 kHz (  6 %)  -    1536000 kHz (100 %)  -  ondemand
Line 46: Line 47:
  
 === 4. [Option] Ubuntu 18.04 - Disable ondemand.service using systemctl === === 4. [Option] Ubuntu 18.04 - Disable ondemand.service using systemctl ===
-In case of Ubuntu 18.04, ondemand.service overrides the default governor,\\ +In case of <color #​ed1c24>​**Ubuntu 18.04**</​color>​, ondemand.service overrides the default governor, so you should disable it to use cpufrequtils.
-so you should disable it to use cpufrequtils.+
 <code bash target> <code bash target>
 $ sudo systemctl disable ondemand $ sudo systemctl disable ondemand
Line 59: Line 59:
  
 ===== Set-up Examples ===== ===== Set-up Examples =====
-==== [Example] ODROID-N2 ​====+=== [Example] ODROID-N2 ===
 == Available governor and cpu frequency sets == == Available governor and cpu frequency sets ==
-<​code>​+<​code ​bash target>
 $ cat /​sys/​devices/​system/​cpu/​cpufreq/​policy0/​scaling_available_governors ​ $ cat /​sys/​devices/​system/​cpu/​cpufreq/​policy0/​scaling_available_governors ​
 ondemand powersave userspace conservative interactive performance schedutil ​ ondemand powersave userspace conservative interactive performance schedutil ​
 </​code>​ </​code>​
-<​code>​+<​code ​bash target>
 $ cat /​sys/​devices/​system/​cpu/​cpufreq/​policy0/​scaling_available_frequencies ​ $ cat /​sys/​devices/​system/​cpu/​cpufreq/​policy0/​scaling_available_frequencies ​
 100000 250000 500000 667000 1000000 1200000 1398000 1512000 1608000 1704000 1896000 100000 250000 500000 667000 1000000 1200000 1398000 1512000 1608000 1704000 1896000
Line 81: Line 81:
 </​code>​ </​code>​
  
-== Restart cpufrequtils ​==+== cpufreq-info ​==
 <code bash target> <code bash target>
 $ sudo service cpufrequtils restart $ sudo service cpufrequtils restart
-sudo cpufreq-info -o+ 
 +$ cpufreq-info -o
           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor
 CPU  0       ​100000 kHz (  5 %)  -    1896000 kHz (100 %)  -  ondemand CPU  0       ​100000 kHz (  5 %)  -    1896000 kHz (100 %)  -  ondemand
Line 93: Line 94:
 CPU  5       ​100000 kHz (  5 %)  -    1800000 kHz (100 %)  -  ondemand CPU  5       ​100000 kHz (  5 %)  -    1800000 kHz (100 %)  -  ondemand
 </​code>​ </​code>​
-==== [Example] ODROID-XU3/​XU4 ​====+=== [Example] ODROID-XU3/​XU4 ===
 == Available governor and cpu frequency sets == == Available governor and cpu frequency sets ==
-<​code>​ +<​code ​bash target
-root@odroid:​~# ​cat /​sys/​devices/​system/​cpu/cpu0/​cpufreq/​scaling_available_governors+cat /​sys/​devices/​system/​cpu/​cpufreq/policy0/​scaling_available_governors
 conservative userspace powersave ondemand performance schedutil conservative userspace powersave ondemand performance schedutil
 </​code>​ </​code>​
-<​code>​ +<​code ​bash target
-root@odroid:​~# ​cat /​sys/​devices/​system/​cpu/cpu0/​cpufreq/​scaling_available_frequencies+cat /​sys/​devices/​system/​cpu/​cpufreq/policy0/​scaling_available_frequencies
 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000
-root@odroid:​~# ​cat /​sys/​devices/​system/​cpu/cpu4/​cpufreq/​scaling_available_frequencies+cat /​sys/​devices/​system/​cpu/​cpufreq/policy4/​scaling_available_frequencies
 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 2000000 200000 300000 400000 500000 600000 700000 800000 900000 1000000 1100000 1200000 1300000 1400000 1500000 1600000 1700000 1800000 1900000 2000000
 </​code>​ </​code>​
Line 108: Line 109:
 == cpufrequtils option == == cpufrequtils option ==
 <code bash target> <code bash target>
-# vim /​etc/​default/​cpufrequtils+$ sudo vi /​etc/​default/​cpufrequtils 
 ENABLE="​true"​ ENABLE="​true"​
 GOVERNOR="​ondemand"​ GOVERNOR="​ondemand"​
 </​code>​ </​code>​
  
-== Restart cpufrequtils ​== +== cpufreq-info ​== 
-<​code>​ +<​code ​bash target
-root@odroid:​~# ​service cpufrequtils restart +$ sudo service cpufrequtils restart 
-root@odroid:​~# ​cpufreq-info -o+ 
 +cpufreq-info -o
           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor
 CPU  0       ​200000 kHz ( 13 %)  -    1500000 kHz (100 %)  -  ondemand CPU  0       ​200000 kHz ( 13 %)  -    1500000 kHz (100 %)  -  ondemand
Line 127: Line 130:
 CPU  7       ​200000 kHz ( 10 %)  -    2000000 kHz (100 %)  -  ondemand CPU  7       ​200000 kHz ( 10 %)  -    2000000 kHz (100 %)  -  ondemand
 </​code>​ </​code>​
- +=== [Example] ODROID-C2 ===
-==== [Example] ODROID-C2 ​====+
 == Available governor and cpu frequency sets == == Available governor and cpu frequency sets ==
-<​code>​ +<​code ​bash target
-root@odroid:​~# ​cat /​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​scaling_available_governors+cat /​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​scaling_available_governors
 hotplug interactive conservative ondemand userspace powersave performance hotplug interactive conservative ondemand userspace powersave performance
 </​code>​ </​code>​
-<​code>​ +<​code ​bash target
-root@odroid:​~# ​cat /​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​scaling_available_frequencies+cat /​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​scaling_available_frequencies
 100000 250000 500000 1000000 1296000 1536000 100000 250000 500000 1000000 1296000 1536000
 </​code>​ </​code>​
Line 141: Line 143:
 == cpufrequtils option == == cpufrequtils option ==
 <code bash target> <code bash target>
-# vim /​etc/​default/​cpufrequtils+$ sudo vi /​etc/​default/​cpufrequtils 
 ENABLE="​true"​ ENABLE="​true"​
 GOVERNOR="​performance"​ GOVERNOR="​performance"​
Line 148: Line 151:
 </​code>​ </​code>​
  
-== Restart cpufrequtils ​== +== cpufreq-info ​== 
-<​code>​ +<​code ​bash target
-root@odroid:​~#​ vim /​etc/​default/​cpufrequtils +$ sudo service cpufrequtils restart 
-root@odroid:​~# ​service cpufrequtils restart + 
-root@odroid:​~# ​cpufreq-info -o+cpufreq-info -o
           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor
 CPU  0       ​100000 kHz (  6 %)  -    1536000 kHz (100 %)  -  performance CPU  0       ​100000 kHz (  6 %)  -    1536000 kHz (100 %)  -  performance
Line 160: Line 163:
 </​code>​ </​code>​
  
-==== [Example] ODROID-C1 ​====+=== [Example] ODROID-C1 ===
  
 == Available governor and cpu frequency sets == == Available governor and cpu frequency sets ==
-<​code>​ +<​code ​bash target
-root@odroid:​~# ​cat /​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​scaling_available_governors+cat /​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​scaling_available_governors
 hotplug interactive conservative ondemand performance hotplug interactive conservative ondemand performance
 </​code>​ </​code>​
-<​code>​ +<​code ​bash target
-root@odroid:​~# ​cat /​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​scaling_available_frequencies+cat /​sys/​devices/​system/​cpu/​cpu0/​cpufreq/​scaling_available_frequencies
 96000 192000 312000 408000 504000 600000 696000 816000 912000 1008000 1104000 1200000 1296000 1416000 1488000 1536000 1632000 1728000 1824000 96000 192000 312000 408000 504000 600000 696000 816000 912000 1008000 1104000 1200000 1296000 1416000 1488000 1536000 1632000 1728000 1824000
 </​code>​ </​code>​
Line 174: Line 177:
 == cpufrequtils option == == cpufrequtils option ==
 <code bash target> <code bash target>
-# vim /​etc/​default/​cpufrequtils+$ sudo vi /​etc/​default/​cpufrequtils 
 ENABLE="​true"​ ENABLE="​true"​
 GOVERNOR="​ondemand"​ GOVERNOR="​ondemand"​
Line 180: Line 184:
 MIN_SPEED=100000 MIN_SPEED=100000
 </​code>​ </​code>​
-== restart cpufrequtils ​== +== cpufreq-info ​== 
-<​code>​ +<​code ​bash target
-root@odroid:​~# ​service cpufrequtils restart +$ sudo service cpufrequtils restart 
-root@odroid:​~# ​cpufreq-info -o+ 
 +cpufreq-info -o
           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor           minimum CPU frequency ​ -  maximum CPU frequency ​ -  governor
 CPU  0        96000 kHz (  5 %)  -    1824000 kHz (100 %)  -  ondemand CPU  0        96000 kHz (  5 %)  -    1824000 kHz (100 %)  -  ondemand