Jump to content

Recommended Posts

Posted

Ever since I read through THIS POST a while back, I started digging through the cpufrequtils init script, and was a more or less disappointed with what I found. It's largely a product of the CPUs that were available around that time (eg - Pentium 3). Namely that all cores in the system are the same, and there's should be only one master policy that controls everything.

 

Of course ARM big.LITTLE totally breaks these assumptions, and leaves the script with no viable way to specify different schedulers or frequency ranges for each CPU cluster. It still runs, but not really correctly. For example, you can't set the RK3399 little cores above 1.4 GHz, but that's basically what it attempts to do on every boot.

 

Also it needs use "cpufreq-set" to do it's job, which seems too hard when the sysfs interface is already pretty simple. Really, that extra complexity isn't buying you a single thing. Maybe it made more sense 10-15 years ago.

 

So I took a crack at doing a far simpler, stupid version of that script (on perhaps smarter depending on perspective). It can generate it's own config, and I think that it comes across much more readable and accessible.

 

###
# CPUFreq policy for CPUs: 0 1 2 3
#

# CPU Frequency Governor
# Avail: conservative ondemand userspace powersave performance schedutil 
POLICY0_GOVERNOR=ondemand

# Min/Max Frequency Selection
# Avail: 408000 600000 816000 1008000 1200000 1416000 
POLICY0_MIN_FREQ=408000
POLICY0_MAX_FREQ=1416000

###
# CPUFreq policy for CPUs: 4 5
#

# CPU Frequency Governor
# Avail: conservative ondemand userspace powersave performance schedutil 
POLICY4_GOVERNOR=conservative

# Min/Max Frequency Selection
# Avail: 408000 600000 816000 1008000 1200000 1416000 1608000 1800000 
POLICY4_MIN_FREQ=408000
POLICY4_MAX_FREQ=1800000

 

And using it isn't too hard ...

 

cp cpufrequtils-bl /etc/init.d/
sudo /etc/init.d/cpufrequtils-bl save
sudo vi /etc/default/cpufrequtils-bl

sudo systemctl disable cpufrequtils
sudo systemctl enable cpufrequtils-bl

 

I know that this is probably pretty far down on the list of priorities, but does anyone thing that this would be useful to others?

 

cpufrequtils-bl

Posted

Adding to armbian-config is certainly a possibility, but as the tool is pending a massive rewrite, and the desired tool for the redesign (Ansible) is not in my bag o tricks, I'll probably hold off on doing that.

 

I almost feel like it might fit better in the Armbian BSP generated from the build system, but am open to opinions.

Posted

Your script is tested on my Tinker Board 2s and it's proved to be effective to setup the correct MAX and MIN for that (instead of that a little aggressive settings by the official armbian image), especially for the hardware with only passive cooling that is placed into a wiring box. 
And it should be considered to share over github or somewhere since other guys might need this too. 

 

Thanks anyway, sir. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines