Skip to content

Instantly share code, notes, and snippets.

@Pyppe
Created July 18, 2013 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pyppe/6028707 to your computer and use it in GitHub Desktop.
Save Pyppe/6028707 to your computer and use it in GitHub Desktop.
My Lenovo Carbon X1 does not up-scale CPUs correctly with Ubuntu 13.04 using the ondemand governing. Lowering the up-threshold seems to do the trick.
#!/bin/bash
# default with 13.04 is 95
SCALING_FILE=/sys/devices/system/cpu/cpufreq/ondemand/up_threshold
if [ ! -f "$SCALING_FILE" ]; then
echo "$SCALING_FILE not found"
exit 1
fi
if [ $# -ne 1 ]; then
echo "Usage: $0 <throttling percentage>"
echo "E.g. $0 70"
exit 1
fi
limit=$1
if [[ $limit -lt 100 && $limit -gt 30 ]]; then
sudo bash -c "echo $limit > $SCALING_FILE"
else
echo "Invalid value"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment