user_freqs usage:
sysfs file - /sys/devices/system/cpu/cpu0/cpufreq/user_freqs
NOTE: It is not possible to disable the policy min or max.
To see the current state of the frequency table:
cat /sys/devices/system/cpu/cpu0/cpufreq/user_freqs
sh-3.2# cd /sys/devices/system/cpu/cpu0/cpufreq/
sh-3.2# cat user_freqs
24576: Enabled
61440: Enabled
122880: Enabled
184320: Enabled
192000: Enabled
245760: Enabled
368640: Enabled
768000: Enabled
806400: Enabled
883200: Enabled
960000: Enabled
1036800: Enabled
1113600: Enabled
1190400: Enabled
1267200: Enabled
1344000: Enabled
1420800: Enabled
1497600: Enabled
1574400: Enabled
1651200: Enabled
1728000: Enabled
sh-3.2#
To enable/disable one frequency:
This is a toggle, if the frequency is enabled, it will disable it, if it's disabled, it will re-enable it.
echo 24576 > /sys/devices/system/cpu/cpu0/cpufreq/user_freqs
sh-3.2# echo 24576 > user_freqs
sh-3.2# cat user_freqs
24576: Disabled
........
sh-3.2# echo 24576 > user_freqs
sh-3.2# cat user_freqs
24576: Enabled
........
sh-3.2#
To disable ALL frequencies outside of the current policy minimum and maximum:
echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/user_freqs
To restore the kernel defaults:
echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/user_freqs
sh-3.2# echo 1 > user_freqs
sh-3.2# cat user_freqs
24576: Disabled
61440: Disabled
122880: Enabled
184320: Enabled
192000: Enabled
245760: Enabled
368640: Enabled
768000: Enabled
806400: Enabled
883200: Enabled
960000: Enabled
1036800: Enabled
1113600: Disabled
1190400: Disabled
1267200: Disabled
1344000: Disabled
1420800: Disabled
1497600: Disabled
1574400: Disabled
1651200: Disabled
1728000: Disabled
sh-3.2# echo 0 > user_freqs
sh-3.2# cat user_freqs
24576: Enabled
61440: Enabled
122880: Enabled
184320: Enabled
192000: Enabled
245760: Enabled
368640: Enabled
768000: Enabled
806400: Enabled
883200: Enabled
960000: Enabled
1036800: Enabled
1113600: Enabled
1190400: Enabled
1267200: Enabled
1344000: Enabled
1420800: Enabled
1497600: Enabled
1574400: Enabled
1651200: Enabled
1728000: Enabled
sh-3.2#
Notice that cpu stats will only show the enabled frequencies:
sh-3.2# echo 1 > user_freqs
sh-3.2# cat user_freqs
24576: Disabled
61440: Disabled
122880: Enabled
184320: Enabled
192000: Enabled
245760: Enabled
368640: Enabled
768000: Enabled
806400: Enabled
883200: Enabled
960000: Enabled
1036800: Enabled
1113600: Disabled
1190400: Disabled
1267200: Disabled
1344000: Disabled
1420800: Disabled
1497600: Disabled
1574400: Disabled
1651200: Disabled
1728000: Disabled
sh-3.2# cat stats/time_in_state
122880 128126
184320 2060
192000 0
245760 27910
368640 0
768000 0
806400 0
883200 0
960000 0
1036800 4948
sh-3.2#