Locking my CPU to “performance” governor on ac AND battery

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
hydn

Locking my CPU to “performance” governor on ac AND battery

Post by hydn »

Basically a few days ago I replaced Windows 7 with Linux Mint 11 on my Lenovo x301. Linux is addictive! Linux Mint (imo a more polished version of Ubuntu) has a sweet little add-on which is the CPU Frequency Scaling Monitor that you can use to adjust your CPU performance on the fly. You should test the gnome CPU applet to confirm whether or not you can change your CPU frequency settings. You won’t be able to change anything unless this is possible.

Now, for me the only issue is, once you reboot, the CPU scaling settings are lost. So you have to make the changes each time you boot! The x301 comes with 1.4 Ghz Intel Core Duo processor. It’s by no means fast but just adequate. Ondemand kept setting it to 0.8Ghz wayyyy too often! Thus, I wanted to lock it at full performance on both AC and battery modes without having to manually tweak after each boot. To accomplish this, I installed cpufrequtils (# sudo apt-get install cpufrequtils).

Notice that in the screenshot below, my CPU (both cores) are at max processing speed 100% of uptime:
Image

Anyone have any other tips on squeezing performance out of slower CPUs?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
TBABill
Level 6
Level 6
Posts: 1355
Joined: Wed Dec 30, 2009 1:02 pm
Location: Leonardtown, MD

Re: Locking my CPU to “performance” governor on ac AND batte

Post by TBABill »

You can generally "feel" more speed from your CPU by using a lighter desktop environment. LXDE, for example, is significantly faster than Gnome and brings life back to slower or older systems.

CPU freq does not speed up your system. The normal cpufreq setting is "ondemand", which is used to keep your machine FROM running at full speed when not needed. The system scales very quickly from slow speeds to max when needed, then slows again when not needed. It saves on power consumption and reduces heat by doing so. It's now become the standard setting among kernels and saves many users the headaches of figuring out how to use the cpufreq-set command to change governor settings. It's a great utility for sure, but not really an area to gain any CPU performance other than when there is no demand or little demand on your CPU.
hydn

Re: Locking my CPU to “performance” governor on ac AND batte

Post by hydn »

Naa! cpufreq does NOT work as it's supposed to on my system. Majority of the times I would be watching videos on vevo.com and it's stays at .8ghz or sometimes 1.2ghz and the video tears, skips, freezes for tiny bits and audio gets messed up. Since I locked it that is fixed and it plays fine.

Or I would open Chrome with my 10 plus tabs remembered and it takes twice as long cause it does the ENTIRE process at 0.8ghz!

What u describe is how it's "supposed" to work on Linux. Don't talk about when I'm on battery! It has not affect my battery life I use to get 2:30 on windows 7 now I get 2:15. I'm on battery for short intervals like today when I travel.

There are other users on ubuntu forums around the web who complain about CPU being locked at half it's speed during heavy tasks, just google it. But cpufreq IS slower because it's not working as it should at least not on all systems.
wyrdoak

Re: Locking my CPU to “performance” governor on ac AND batte

Post by wyrdoak »

Have you tried this? I can just click on the applet and change it from the defaults if I wish.



reconfigure gnome-applets:

sudo dpkg-reconfigure gnome-applets

You’ll be presented with a blue screen that explains that you can run the cpu-selector with root privileges. Answer yes to this.

Once that is done you’ll be able to switch between frequencies. Right-click on the frequency applet and you’ll now have a selection of options available to you. Among these will be the option to choose power mode, as well as the option to set the frequency directly.

The changes you make here will only be temporary, however. If you need to set a new, permanent, default choice you need to do a little more work. From a command line type:

gconf-editor

With that launched, choose apps -> gnome-power-manager -> cpufreq. You then need to change the policy_ac and policy_battery settings to the options you prefer as the default.
hydn

Re: Locking my CPU to “performance” governor on ac AND batte

Post by hydn »

The changes you make here will only be temporary,
Yea already use that. That's how I figured out it was stuck to .8ghz using on demand.

As you can see from screenshot above (look for the line "cpufreq stats") I've already figured out how to make frequency settings permanent.

thx
wyrdoak

Re: Locking my CPU to “performance” governor on ac AND batte

Post by wyrdoak »

I got a broken link as a screenshot. But anyway at least you got a permanent setting now.
jbrathod88

Re: Locking my CPU to “performance” governor on ac AND batte

Post by jbrathod88 »

One can try this:---

1> Goto /etc/init.d with root privilege.
2> Open the file "cpufrequtils" using text editor( I have SciTE Text editor ).
3> Change the line:--
ENABLE="true"
GOVERNOR="ondemand"
to
ENABLE="true"
GOVERNOR="performance"
-- edit rest lines as required. and save.
4> Restart your pc. and see it changed!.

I cannot change the file using gedit. Maybe any problem with my gedit installation. so if you also face problem saving the file using gedit then try SciTE or other text editor.
Locked

Return to “Hardware Support”