CPU load vs. Turbo mode


31 posts   Page 1 of 2   1, 2
by xbs » Tue Oct 16, 2012 10:50 am
Turbo mode only kicks in when arm usage is 100% AFAIK.

Is it possible to change this value?

It would be great if we could set this percentage manually.

TIA
Posts: 13
Joined: Thu Oct 04, 2012 1:06 pm
by xbs » Mon Oct 22, 2012 10:38 am
This did it :)

Code: Select all
#!/bin/sh
( sleep 20
echo 60 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
)&
Posts: 13
Joined: Thu Oct 04, 2012 1:06 pm
by thradtke » Tue Oct 23, 2012 6:33 am
Out of interest - what is it good for?
Full-time noob forever.
Posts: 432
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL
by xbs » Thu Oct 25, 2012 5:09 pm
Well, I don't want the dynamic OC to kick in when the CPU is at 95%. I want it to jump from 700mhz to 900mhz when the CPU as a load of 50% or 60%. This makes the XBMC GUI a bit smoother and faster.

Basically, I want the TRPi to be OC'ed when in use, unless isn't really needed, and to go back to default when idle.

I keep the RPi 24/7 so I just need the extra juice when I'm using it and not while sitting without doing nothing.
Posts: 13
Joined: Thu Oct 04, 2012 1:06 pm
by abishur » Mon Oct 29, 2012 8:19 pm
Do you just run that script on boot, or are you changing something in another file. I haven't looked too extensively into the turbo options beyond "does it work, and what are the symptoms when it doesn't" so I'm curious if this threshold is a multitiered thing (you increment the first step at x% of load, the second at y% of load and so forth and so on). Or is it you accelerate to the turbo options at the cpu "% you set?
Dear forum: Play nice ;-)
User avatar
Forum Moderator
Forum Moderator
Posts: 4298
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
by xbs » Tue Oct 30, 2012 9:14 am
Yeah, i run the script (autostart.sh) at boot.
I'm currently using 50 up_threshold and it's working great.

AFAIK it's not, the RPi dynamic OC it's an On/Off thing.
There's only one OC value and that only kicks in when up_threshold is met (default 95).
Posts: 13
Joined: Thu Oct 04, 2012 1:06 pm
by MattSwarbrick » Tue Oct 30, 2012 11:25 am
That sounds good, was wondering whether the turbo was actually kicking in... Where did you place your script to run on start up? can you just add commands in rc.local?
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by MattSwarbrick » Tue Oct 30, 2012 11:54 am
Ok, well it seems to work if you put this:
Code: Select all
echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold

into the rc.local script which runs on startup.
You can edit the rc.local script with the following command:
Code: Select all
sudo nano /etc/rc.local

Then add the above command into the file, above where it prints the IP or something, then it should work.
You can view CPU usage by running top, the process I was playing with was running on 70% now runs on 40% with overclock and the threshold set
Posts: 27
Joined: Thu Oct 04, 2012 3:15 pm
by xbs » Tue Nov 06, 2012 1:25 pm
I have the script in
Code: Select all
/storage/.config/autostart.sh

You need to make it exec
Code: Select all
#!/bin/sh
(sleep 20
echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
)&
Posts: 13
Joined: Thu Oct 04, 2012 1:06 pm
by munklefish » Thu Nov 15, 2012 12:05 am
Does this still comply with the warranty requirements??
http://www.codeclinic.de
Posts: 74
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
by xbs » Thu Nov 15, 2012 11:04 am
afaik it does NOT void the warranty but I could be wrong :) you're just forcing the OC to kick in 'sooner'.
Posts: 13
Joined: Thu Oct 04, 2012 1:06 pm
by munklefish » Thu Nov 15, 2012 11:55 am
Ok, thanks.

Out of interest, does the sleep 20 indicate the load at which oc switches off?
http://www.codeclinic.de
Posts: 74
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
by xbs » Thu Nov 15, 2012 12:16 pm
No, sleep 20 is to give the system time to set the value so that we can change it after. Without sleep 20 the custom value would be applied before the system default value (95) and replaced.
The 50 is the cpu load in % that triggers the OC (default 95).
Posts: 13
Joined: Thu Oct 04, 2012 1:06 pm
by munklefish » Thu Nov 15, 2012 6:55 pm
Ah of course. I took sllep too literally, or not literally enough. Im not sure. :D
http://www.codeclinic.de
Posts: 74
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
by munklefish » Fri Nov 23, 2012 3:20 pm
So,

Ive set my cpu to idle at 300MHz and discussed the merits of this on the forum.

However, 1 thing that I noticed is that doing something simple like rescanning the file system in an ownCloud installation causes the cpu to almost instantly jump upto the overclocking speed. With no discernible step between the idle and the maximum.

This suggests that because the idle is so low, it doesnt take much effort for the cpu to hit heavy load at this speed. Does this in turn mean that the cpu jumps into turbo mode at a given percentage of its current speed rather than its preset 'base' frequency?

If so, would it not be better to set a low idling speed for the cpu rather than manually reducing the level at which turbo/oc kicks in?

On, is this just coincidental??
http://www.codeclinic.de
Posts: 74
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
by xbs » Fri Nov 23, 2012 3:57 pm
Afaik the RPi only has two speeds, the 'non turbo' and the turbo.
When the trigger is reached it enters turbo mode, so having a low non turbo will kick turbo in with little effort.
Posts: 13
Joined: Thu Oct 04, 2012 1:06 pm
by munklefish » Fri Nov 23, 2012 4:32 pm
xbs wrote:Afaik the RPi only has two speeds, the 'non turbo' and the turbo.
When the trigger is reached it enters turbo mode, so having a low non turbo will kick turbo in with little effort.


So, essentially IT IS better to set a low idling speed via the config.txt file rather than doing the following:

xbs wrote:I have the script in
Code: Select all
/storage/.config/autostart.sh

You need to make it exec
Code: Select all
#!/bin/sh
(sleep 20
echo 50 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
)&


????

Setting idle speed via config is a simple 'cpu_idle = 300' rather than doing the above. It also means that you might use less electricity by having the idle cpu running at a lower frequency.

:)
http://www.codeclinic.de
Posts: 74
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
by xbs » Fri Nov 23, 2012 5:54 pm
If one sets the cpu_idle too low navigating the UI of XBMC will trigger the OC.
Which it is not a bad thing at all, having it running @ 300mhz idle and OC'ed when in use.

Is it stable @ 300 Mhz?
Posts: 13
Joined: Thu Oct 04, 2012 1:06 pm
by munklefish » Fri Nov 23, 2012 6:29 pm
Yes.

Had it running on a 256mb board over varying periods.

Got a new 512mb board yesterday, and popped it on their. So been running for 23.5hrs, now.

I run headerless, so graphics memory is set to 16mb or 32mb(cant remember which, but certainly no more than 32mb), and i have raspcontrol and owncloud running on it. Refreshing the page on raspcontrol doesnt even budge the cpu from 300mhz. Doing a file rescan in owncloud(dropbox clone) does bump it into turbo mode but nothing else seems to.

So running both of those via apache, plus mysql, and it still takes it all in its stride at 300mhz.

So, only real work makes it go into turbo, and it runs smooth either way.
http://www.codeclinic.de
Posts: 74
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
by munklefish » Sat Nov 24, 2012 6:33 pm
munklefish wrote:Yes.
Got a new 512mb board yesterday, and popped it on their. So been running for 23.5hrs, now.


Now 2 days solid.
http://www.codeclinic.de
Posts: 74
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
by doveman » Thu Feb 21, 2013 7:00 pm
Isn't there an issue with just setting the idle speed to something low like 300Mhz, as if the OC value is left at 95%, it might jump from idle to Turbo mode as soon as the user does something but then it will soon fall below 95% and drop back down again, to idle speed I guess, so there'll constantly be this pin-ponging?

Changing the OC value to 50-60% instead (or as well) should prevent this as mostly the CPU is above this when the user is operating XBMC.
Posts: 163
Joined: Wed Dec 07, 2011 11:52 am
by munklefish » Thu Feb 21, 2013 7:53 pm
doveman wrote:Isn't there an issue with just setting the idle speed to something low like 300Mhz, as if the OC value is left at 95%, it might jump from idle to Turbo mode as soon as the user does something but then it will soon fall below 95% and drop back down again, to idle speed I guess, so there'll constantly be this pin-ponging?

Changing the OC value to 50-60% instead (or as well) should prevent this as mostly the CPU is above this when the user is operating XBMC.


Im not sure what your point is sorry. Surely jumping from idle to turbo is a good thing, since the cpu is either idle or running at turbo whenever in use. EG: In use = Turbo, Not in use = Idle.

Basically overclocking without breaking the warranty! Win/Win unless I'm missing something ???
http://www.codeclinic.de
Posts: 74
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
by doveman » Thu Feb 21, 2013 8:07 pm
The point I was trying to make is that it will constantly be jumping from idle to turbo speeds, which doesn't sound ideal and it would be better if it would mostly stay at turbo speeds when being used (i.e. CPU over 50-60%) which can be achieved by changing the up_threshold.
Posts: 163
Joined: Wed Dec 07, 2011 11:52 am
by munklefish » Thu Feb 21, 2013 8:18 pm
doveman wrote:The point I was trying to make is that it will constantly be jumping from idle to turbo speeds, which doesn't sound ideal and it would be better if it would mostly stay at turbo speeds when being used (i.e. CPU over 50-60%) which can be achieved by changing the up_threshold.


Try it. It either idles at 300mhz or runs in turbo.
http://www.codeclinic.de
Posts: 74
Joined: Tue Oct 02, 2012 5:35 pm
Location: Neumarkt in der Oberpfalz
by doveman » Thu Feb 21, 2013 8:27 pm
No thanks, I'm just going to change the cpu threshold as you haven't said anything to stop me from believing that this ping-ponging will happen without changing it.
Posts: 163
Joined: Wed Dec 07, 2011 11:52 am