| The Following User Says Thank You to ixxe For This Useful Post: | ||
| The Following User Says Thank You to ixxe For This Useful Post: | ||
| The Following User Says Thank You to on3st4b For This Useful Post: | ||
#!/usr/bin/perl
my $lower = "125"; # this value is optimal for powersaving in ondemand mode.
my $upper = "805"; # this value is the highest in MHz at any time.
# set the maximum ondemand level to the desired high performance level
my $cmd = "echo ".$upper."000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq";
system $cmd;
# toggle the high performance mode or normal mode
my $freq = `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq`;
chomp $freq;
if ($freq !~ /^$upper/) {
$freq = $upper;
} else {
$freq = $lower;
}
my $cmd = "echo ".$freq."000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq";
system $cmd;
print "$freq\n";