PDA

View Full Version : Atom CPU automatic frequency scaling without speedstep



coozoo
3rd December 2014, 11:56 PM
Hi not sure about usefulness of this guide but provide it as is :) At least you can try and modify.
This guide can be applicable to some other atoms (I've read that some laptops have it) or some old pentiums.
Pre story I have old ITX pc with Atom CPU which doesn't have speed step on a board. As it doesn't have speed step automatic CPU scaling doesn't work.
My target to control frequency automatically on these types of CPUs.


At first I need to identify my CPU and load appropriate driver.
Exucute and you will see your model:

$ cat /proc/cpuinfo|grep "model name"|head -n 1
Result:

model name : Intel(R) Atom(TM) CPU 330 @ 1.60GHz
Now try to get frequency info:

$ cpupower frequency-info
Result:

analyzing CPU 0:
no or unknown cpufreq driver is active on this CPU
boost state support:
Supported: no
Active: no
That's means that cpufreq not loaded.

So let load appropriate driver:

$ sudo modprobe p4-clockmod
And try to get frequency info again:

$ cpupower frequency-info
Result:

analyzing CPU 0:
driver: p4-clockmod
CPUs which run at the same hardware frequency: 0 2
CPUs which need to have their frequency coordinated by software: 0 2
maximum transition latency: 10.00 ms.
hardware limits: 200 MHz - 1.60 GHz
available frequency steps: 200 MHz, 400 MHz, 600 MHz, 800 MHz, 1000 MHz, 1.20 GHz, 1.40 GHz, 1.60 GHz
available cpufreq governors: conservative, userspace, powersave, ondemand, performance
current policy: frequency should be within 200 MHz and 1.60 GHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 600 MHz (asserted by call to hardware).
boost state support:
Supported: no
Active: no

As you can see it works so now we can add it permanently to load at boot.
To do this execute two commands:

$ sudo echo "p4-clockmod" > /etc/modules-load.d/p4-clockmod.conf
$ sudo chmod 755 /etc/modules-load.d/p4-clockmod.conf



So now we can change governors but really whatever you choose it wouldn't perform automatic CPU scaling.
For example:

powersave - just drop frequency to minimum;
performance - set frequency to maximum;
conservative, userspace, ondemand - doesn't change frequency.

So what is the solution!? Yes it's stupid solution.

Bash script! :)
Just save it, make file executable and run it as sudo.

Yes it will work if CPU has speed step but don't forget to change your governor back.
For example with this command:

$ sudo cpupower frequency-set -g ondemand

So actually script it's pretty well commented so just read.
I'm just cutting frequencies below 500Mhz because it's very slow.
And excluding HT CPU from scaling.
It's not a perfect but it works :doh:

see below to find script
http://docs.google.com/uc?export=download&id=0BxdJaRbJyqkOZXpaa0ZSSlpvdU0

Just launch in terminal an you will see output for every attempt to change CPU. It' good for education.
But if you want to use it as daemon I suggest you comment some echoes in loop.

Have fun :dance: