Topic: linux cpu throttling fix isn't persistent - why?
I used the cpu throttling fix in the Linux distribution README:
CPU throttling can be disabled by the command:
sudo cpufreq-set -c 0 -g performance (disable on the first cpu core)
sudo cpufreq-set -c 1 -g performance (disable on the second core)
... (repeat for each CPU core)
.. but I noticed that it wasn't persistent; after 5 or 10 minutes or sometimes longer, the throttling ('powersave') resumed.
So I used a script found in this thread which runs through each core and also disables throttling in a slightly different way:
http://www.forum-pianoteq.com/viewtopic.php?id=3397
The script isn't the issue, just mentioning it for context.
It's not a real problem as I implemented a kludge to kick off the script every 5 minutes in cron:
# m h dom mon dow command
@reboot /usr/bin/governor performance > /var/log/governor.log 2>&1
*/5 * * * * /usr/bin/governor performance > /var/log/governor.log 2>&1
But I'd like to know why this is happening. Any ideas?
For completeness here's the script mentioned in the thread, but again, the script isn't the issue (otherwise it wouldn't work when executed every 5 minutes, and I found the problem before I found the script):
#!/bin/sh
# http://www.forum-pianoteq.com/viewtopic.php?id=3397
cd /sys/devices/system/cpu
gov="$1"
if [ "$gov" = "" ]; then
for core in cpu?; do
echo -n "Core ${core} set to "
cat ${core}/cpufreq/scaling_governor
done
else
if [ "`whoami`" != "root" ]; then
echo "Root access is required for this operation. Trying sudo..."
exec sudo "$0" "$@"
fi
for core in cpu?; do
echo "Setting core ${core} to ${gov}... "
echo "$gov" > ${core}/cpufreq/scaling_governor
done
fi
Thanks,
Mark