Skip to content

Instantly share code, notes, and snippets.

@jynik
Created April 1, 2014 04:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jynik/9907605 to your computer and use it in GitHub Desktop.
Save jynik/9907605 to your computer and use it in GitHub Desktop.
Set all CPU frequency scaling governors to 'performance'
#!/bin/sh
#
# Set frequency scaling governer to 'performance' on all cores
set -e
GOVERNOR=performance
SYS_PATH=/sys/devices/system/cpu
for cpu in `ls $SYS_PATH | grep 'cpu[0-9]\+'`; do
CPU_SCALING_GOVERNOR=$SYS_PATH/$cpu/cpufreq/scaling_governor
current=`cat $CPU_SCALING_GOVERNOR`
echo "$cpu is currently '$current', setting to 'performance'"
echo $GOVERNOR | sudo tee -a $CPU_SCALING_GOVERNOR > /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment