CPU governors | Ondemand / Interactive / Powersave

Post Reply
User avatar
Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 0
Contact:

CPU governors | Ondemand / Interactive / Powersave

Unread post by Fourdee » Thu Mar 17, 2016 3:23 am

I noticed the default kernel config only has performance and hotplug cpu governors, on 3.14:https://github.com/hardkernel/linux/tre ... dc2-3.14.y

Is there any reason for this?

I compiled the kernel myself and enabled Ondemand, Powersave and Interactive. They appear to be fully functional and the ondemand governor should vastly reduce heat and power consumption when idle. Because of these benefits, I would even go as far to say, the Ondemand governor should be default on all Odroid Kernels.
Untitled.png
(28.04 KiB) Downloaded 2514 times

Code: Select all

root@DietPi:/boot# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
interactive ondemand powersave performance

root@DietPi:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
ondemand

root@DietPi:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
100000 40
250000 618
500000 201
1000000 65
1296000 14
1536000 0
1752000 3
2016000 5043

root@DietPi:~# uname -a
Linux DietPi 3.14.29 #1 SMP PREEMPT Wed Mar 16 17:25:32 GMT 2016 aarch64 GNU/Linux
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

User avatar
odroid
Site Admin
Posts: 31377
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 52 times
Been thanked: 184 times
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by odroid » Thu Mar 17, 2016 10:49 am

We just didn't test other governors intensively.
If the "ondemand" governor is quite stable and useful, we will also include it in our official Kernel too.
Please keep using it for a week and let us know the result.

Anyway, really happy to see the 64bit DietPi OS on the C2. :D

User avatar
Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by Fourdee » Fri Mar 18, 2016 12:44 am

odroid wrote:We just didn't test other governors intensively.
If the "ondemand" governor is quite stable and useful, we will also include it in our official Kernel too.
Please keep using it for a week and let us know the result.

Anyway, really happy to see the 64bit DietPi OS on the C2. :D
Thanks, aiming to release DietPi image under beta today.
Full credit to Meveric for creating the exceptional Jessie arm64 image DietPi is built on: http://forum.odroid.com/viewtopic.php?f=138&t=19403

For anyone who wants to test addtional CPU govs, I've hosted the kernel on dietpi.com:

Code: Select all

#3.14.29
# .config defaults
# + CPU Govs | ondemand, powersave, interactive
# - Virtualization
wget http://dietpi.com/downloads/binaries/c2/C2_DietPi_Kernel.zip -O package.zip
unzip -o package.zip -d /
rm package.zip
Set ondemand:

Code: Select all

echo -e "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

User avatar
lsvg
Posts: 42
Joined: Thu Mar 03, 2016 7:26 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by lsvg » Fri Mar 18, 2016 6:47 am

Will do some tests :)

Kowalski81
Posts: 2
Joined: Sat Mar 12, 2016 9:55 pm
languages_spoken: english, french
ODROIDs: No one, looking for C2
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by Kowalski81 » Fri Mar 25, 2016 11:55 pm

a little hint for people who want hotplug at boot and not performance for cooling down CPU in ubuntu:
edit /etc/init.d/cpufrequtils
replace
GOVERNOR="ondemand"
by
GOVERNOR="hotplug"

I share this because my C2 is always on and I don't want full freq all the time.

User avatar
Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by Fourdee » Mon Apr 11, 2016 11:23 pm

odroid wrote:We just didn't test other governors intensively.
If the "ondemand" governor is quite stable and useful, we will also include it in our official Kernel too.
Please keep using it for a week and let us know the result.

Anyway, really happy to see the 64bit DietPi OS on the C2. :D
Ok, I've been using ondemand for a few weeks and seems 100% stable. Its also the default for the DietPi C2 image, we have had no reports of issues from our users.

I'd highly recommend setting the C2 kernel to ondemand by default. It vastly reduces heat and power consumption when the device is idle.
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

crashoverride
Posts: 4470
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 52 times
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by crashoverride » Tue Apr 12, 2016 12:39 am

Fourdee wrote:I'd highly recommend setting the C2 kernel to ondemand by default.
Can you provide some benchmarks that show the performance difference with the different governors?

User avatar
Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by Fourdee » Tue Apr 12, 2016 2:50 am

crashoverride wrote:
Fourdee wrote:I'd highly recommend setting the C2 kernel to ondemand by default.
Can you provide some benchmarks that show the performance difference with the different governors?
There are no performance differences with interactive and ondemand vs performance. The clocks will scale as required, ondemand has a latency of 10-100ms before the clocks are scaled up. Depends on the following values

Code: Select all

cat /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
The value is in microseconds. So a value of 10000 = 10ms.
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

User avatar
Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by Fourdee » Tue Apr 12, 2016 2:59 am

Power usage when idle:

Performance
performance.jpg
(255.58 KiB) Downloaded 2062 times
Ondemand
ondemand.jpg
(233.32 KiB) Downloaded 2062 times
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

konradsa
Posts: 48
Joined: Wed Mar 09, 2016 4:33 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by konradsa » Tue Apr 12, 2016 5:00 am

Fourdee wrote:Power usage when idle:

Performance
performance.jpg
Ondemand
ondemand.jpg
So it goes from 1.9 to 1.8 Watts? Not really that much of a difference. Do you have some USB peripherals attached, or why is the wattage so close to 2 Watts already?

I guess I would do it more for the temperature difference rather than the power savings, since a cooler CPU gives you a little more headroom when you actually have to ramp up. What is the difference in idle temperature?

User avatar
odroid
Site Admin
Posts: 31377
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 52 times
Been thanked: 184 times
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by odroid » Tue Apr 12, 2016 10:16 am

I can see 1.8~1.9 Watts power consumption on my Ubuntu when there is no USB, HDMI, Ethernet connections at idle state.
I am using the performance governor. The CPU temp is 35C with the stock heat sink at 20C of ambient temperature.

konradsa
Posts: 48
Joined: Wed Mar 09, 2016 4:33 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by konradsa » Tue Apr 12, 2016 11:00 am

odroid wrote:I can see 1.8~1.9 Watts power consumption on my Ubuntu when there is no USB, HDMI, Ethernet connections at idle state.
I am using the performance governor. The CPU temp is 35C with the stock heat sink at 20C of ambient temperature.
Nevermind, 1.8 - 1.9 W is not a lot, I was thinking of 2A, which is what 10W PSU would provide.

So doesn't look like ondemand makes a lot of difference compared to performance, I tried it out, neither in power consumption nor in temperature.

User avatar
Fourdee
Posts: 298
Joined: Fri Apr 03, 2015 5:01 am
languages_spoken: english
ODROIDs: C1 / C2 / XU4 + Cloudshell.
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by Fourdee » Tue Apr 12, 2016 6:58 pm

konradsa wrote:
odroid wrote:I can see 1.8~1.9 Watts power consumption on my Ubuntu when there is no USB, HDMI, Ethernet connections at idle state.
I am using the performance governor. The CPU temp is 35C with the stock heat sink at 20C of ambient temperature.
Nevermind, 1.8 - 1.9 W is not a lot, I was thinking of 2A, which is what 10W PSU would provide.

So doesn't look like ondemand makes a lot of difference compared to performance, I tried it out, neither in power consumption nor in temperature.
Did a re-test this morning:
- Latest kernel 3.14.29 #2 SMP PREEMPT Mon Apr 11 15:31:45 BST 2016 aarch64 GNU/Linux
- Network + power + EMMC is the only thing plugged into the C2
- C2 rev0.1

Idle stats:
Performance = 1.9W
Ondemand = 1.8W
Network in use = 0.3W

Network test code (no disk write):

Code: Select all

wget "http://dietpi.com/downloads/images/DietPi_Odroid-C1-(Jessie).7z" -O /dev/null
So yes, 0.1W is not "vast", however its 5.2%~ power saving when idle. Worth it in my eyes. The other benefit of lower power consumption is reduced s905 temp when idle (3-5'c during my tests).
http://DietPi.com - Lightweight justice for your Odroid.
DietPi web hosting is powered by http://MyVirtualServer.com

User avatar
lsvg
Posts: 42
Joined: Thu Mar 03, 2016 7:26 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: CPU governors | Ondemand / Interactive / Powersave

Unread post by lsvg » Thu Apr 14, 2016 6:43 am

Yes, I can confirm, that in ondemand temp is much better :) - I am using it for two weeks also without any problems.

Post Reply

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest