Author Topic: Speed baby Speed! (CPUFREQ settings)  (Read 12755 times)

Offline lawrence

  • Administrator
  • Sr. Member
  • *****
  • Posts: 300
  • Karma: +15/-0
    • View Profile
Speed baby Speed! (CPUFREQ settings)
« on: January 27, 2013, 03:28:45 am »
The A10 SoC was designed for tablets, so the kernel defaults are more toward saving battery / power, rather than speed.  For cubieboard use, we don't care as much about that, as there is no battery, so its better to use more appropriate settings.

The default cpu frequency scaling in quite a few of the kernels out there is a bit er, underwhelming.
You can make it faster and better :)

Depending on what your kernel has compiled in, you can change both the governor (which handles frequencies etc), and the max / min for scaling frequencies.


This is what I use:

You can add this in your startup in /etc/rc.local or similar.
It assumes you have the ondemand governor compiled in. If you don't you'll need to see the second part of this post.


NOTE:

I should also add that I specifically set the ondemand settings for max / min and other specific ondemand settings even if I don't necessarily use ondemand (although I am in the example below).

I do this because not all kernels have all governors compiled in, and if my governor of choice isn't there, its like a failback (as pretty much all kernels I've seen have ondemand or at least ladder / menu compiled in).




---

#If you wanted to use performance, which is more appropriate for a desktop change that below, and uncomment out the appropriate line.

#suitable for battery driven devices.  comment /uncomment one of the below for YOUR needs.
#echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

#I deliberately set these even though it may not be used for your governor choice.
echo 1008000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo 1008000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq

echo 25 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
----



Kernel Frequency Settings
So, you'd like some speedy kernel wouldn't you.  Well, not all kernels have that built in, as not all devices are the same, and not everyone knows every setting.

So, how do we set our kernel frequencies bits and bobs?

Well, those are set in the kernel config when you build - with the  CONFIG_CPU_FREQ  choice.

Details on speeds for  that are here - in the kernel   - arch/arm/mach-sun4i/cpu-freq

Governor config is in your .config for the kernel when you compile.


Mine is something like -

CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
...


What I choose and what others need are not the same though, so you'll need to pick appropriate options (assuming you compile your own kernel), or pick someones kernel that does what you need.

Lawrence.
« Last Edit: January 29, 2013, 03:28:18 am by lawrence »

Offline lawrence

  • Administrator
  • Sr. Member
  • *****
  • Posts: 300
  • Karma: +15/-0
    • View Profile
Re: Speed baby Speed! (CPUFREQ settings)
« Reply #1 on: January 27, 2013, 03:36:31 am »
Thought I'd add an example of a kernel with a slow default setting -


If you see BogoMIPS speeds like this - THATS BAD! (You can get MUCH faster!)

Code: [Select]
cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 59.90
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2

Hardware : sun4i
Revision : 0000
Serial : 0000000000000000

Offline lawrence

  • Administrator
  • Sr. Member
  • *****
  • Posts: 300
  • Karma: +15/-0
    • View Profile
Re: Speed baby Speed! (CPUFREQ settings)
« Reply #2 on: January 27, 2013, 03:42:38 am »
And an example of a "good" cpu rating - which is what we *should* be getting +- speedwise.


Code: [Select]
cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 1006.38
Features : swp half thumb fastmult vfp edsp neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2

Hardware : sun4i
Revision : 0000
Serial : 0000000000000000

icCE

  • Guest
Re: Speed baby Speed! (CPUFREQ settings)
« Reply #3 on: January 28, 2013, 03:09:21 am »
disable ondemend.

# update-rc.d ondemend stop

or

# vi /etc/init.d/ondemand

Code: [Select]
for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
        do
                [ -f $CPUFREQ ] || continue
                echo -n ondemand > $CPUFREQ
        done

change ondemand on performance

Offline Zoyla1

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Speed baby Speed! (CPUFREQ settings)
« Reply #4 on: April 03, 2015, 05:37:41 am »
I tried lots of image files but none of them have required kernel, modules on it.Then i tried to make my own kernel and i wrote it on my sd-card then boot up stuck at a point.