View previous topic :: View next topic |
Author |
Message |
i92guboj Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/5913531844c4d36a8e43f9.jpg)
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Tue Aug 16, 2011 10:15 am Post subject: cpufrequtils vs ncpufreqd (or any other) |
|
|
Hello.
This post is more aimed to satisfy my curiosity than to solve any real problem.
Some days ago I was bored and looking around found that there are many different implementation for power saving daemons. I guess they all do more or less the same but I always have used cpufrequtils with the ondemand governor for no particular reason. I guess I just happened to stump on it when looking for power saving stuff years ago.
So, I wanted to know what do people around use, and why. Does anyone know if there's any advantage in, let's say, using ncpufreqd, cpufreqd or any other over cpufrequtils?
Cheers and thanks for any response. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
solamour l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/1195961791674d58f9894e9.png)
Joined: 21 Dec 2004 Posts: 726 Location: San Diego, CA
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
i92guboj Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/5913531844c4d36a8e43f9.jpg)
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Tue Aug 16, 2011 11:02 am Post subject: |
|
|
Thanks, that guide is a good place to start researching. ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Gusar Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
Joined: 09 Apr 2005 Posts: 2665 Location: Slovenia
|
Posted: Tue Aug 16, 2011 11:43 am Post subject: |
|
|
I don't use any such daemons. I don't see the point. Ondemand does it's job just fine by itself. And if I ever need full performance, a simple script to change the governor is all that's needed. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Ant P. Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
Joined: 18 Apr 2009 Posts: 6920
|
Posted: Tue Aug 16, 2011 9:38 pm Post subject: |
|
|
A lot of those were written when cpu frequency changing was still new, and ondemand wasn't all that effective back then. Some of them integrate with acpi and the like to switch speed on battery/temperature events if you have a use for that sort of thing. ACPI takes care of overheating automatically though.
Ondemand is good enough for 99% of people nowadays (though I still have to set up my eee's cpufv control manually...) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Cyker Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
Joined: 15 Jun 2006 Posts: 1746
|
Posted: Wed Aug 17, 2011 5:30 pm Post subject: |
|
|
+1 for on demand! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
DirtyHairy l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/gallery/Monkey Island/Monkey_Island_-_Murray.gif)
Joined: 03 Jul 2006 Posts: 608 Location: Würzburg, Deutschland
|
Posted: Wed Aug 17, 2011 5:42 pm Post subject: |
|
|
I'm also on the ondemand boat without any userspace sugar on top, works great. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
i92guboj Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/5913531844c4d36a8e43f9.jpg)
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Wed Aug 17, 2011 10:38 pm Post subject: |
|
|
Great, keep suggestions coming. Thank you everyone ![Smile :)](images/smiles/icon_smile.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Ormaaj Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/gallery/Diablo/Diablo_2_-_Barbarian.gif)
Joined: 28 Jan 2008 Posts: 319
|
Posted: Thu Aug 18, 2011 9:24 am Post subject: |
|
|
Cpufrequtils isn't a daemon. The only ones which are actual daemons are the so-called "userspace daemons" which make use of the userspace performance governor. (diagram). Otherwise no matter which you use, the governors themselves are kernel modules whose only function AFAICT is to dynamically adjust the ACPI p-states. With {performance, ondemand, conservative}, the algorithm which does the scaling is in the kernel and you're just picking a profile from the three, and with the userspace govenor, the algorithm is controled by the userspace daemon which instructs the cpufreq module how to scale in real time. The cpufreq-utils is just a frontend for querying and sending signals to sysfs to alter which of the in-kernel governor algorithms is in use from the default set during kernel config. (IMO it would make more sense to make this an eselect module rather than an initscript.)
For those with recent Intel chips running the "Intel idle" driver, it appears the CPU has additional control over (perhaps beyond) P-states. The i7z author recommends using no governor (or the performance governor which I think is equivalent to disabling cpu frequency scaling.) However my tests show that the CPU tends to not reach as deep of sleep states when using only the idle driver - which may or may not be a good thing. Since Intel recommends using the ondemand governor , and according to the kernel help documentation, intel_idle and ondemand are not mutually exclusive, I would recommend enabling both. I wouldn't recommend a userspace governor. It isn't necessary.
The one tweak I would recommend is setting sampling_down_factor to some value much greater than zero. I did some profiling under heavy load and kernel overhead is significantly reduced. Specifically, context switches reduced by around 95%.
https://forums.gentoo.org/viewtopic-p-6722257.html#6722257 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Unrealized n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 12 Jun 2011 Posts: 5
|
Posted: Thu Aug 18, 2011 10:31 am Post subject: |
|
|
I use ondemand governor and cpufrequtils.. It works fine on my box. _________________ Gentoo ~amd64 | AMD Athlon II X3 450 3.2GHz | 4gB DDR3 1333MHz | GeForce 9500GT. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
disi Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/gallery/Zelda/Zelda_-_Link.jpg)
Joined: 28 Nov 2003 Posts: 1354 Location: Out There ...
|
Posted: Mon Sep 12, 2011 5:50 pm Post subject: |
|
|
Hmm, I experiment here a little. With i7z you actual get quiet different results than the system tells me with ondemand governor ^^
watching a movie:
Code: | Cpu speed from cpuinfo 2294.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 2294 MHz
CPU Multiplier 23x || Bus clock frequency (BCLK) 99.74 MHz
Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]
TURBO ENABLED on 4 Cores, Hyper Threading ON
True Frequency 2393.74 MHz (99.74 x [24])
Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is 34x/33x/31x/31x
Current Frequency 990.46 MHz [99.74 x 9.93] (Max of below)
Core [core-id] :Actual Freq (Mult.) C0% Halt(C1)% C3 % C6 % C7 % Temp
Core 1 [0]: 807.26 (8.09x) 12.5 15.9 3.02 1 75.7 45
Core 2 [1]: 990.46 (9.93x) 10 8.66 1.03 1 85 42
Core 3 [2]: 826.33 (8.28x) 4.21 3.29 1 1 93.2 48
Core 4 [3]: 813.52 (8.16x) 3.59 8.72 2.82 1 86.2 44
C0 = Processor running without halting
C1 = Processor running with halts (States >C0 are power saver)
C3 = Cores running with PLL turned off and core cache turned off
C6 = Everything in C3 + core state saved to last level cache
Above values in table are in percentage over the last 1 sec
[core-id] refers to core-id number in /proc/cpuinfo
'Garbage Values' message printed when garbage values are read
Ctrl+C to exit
|
ripping a movie on one core:
Code: |
Cpu speed from cpuinfo 2294.00Mhz
cpuinfo might be wrong if cpufreq is enabled. To guess correctly try estimating via tsc
Linux's inbuilt cpu_khz code emulated now
True Frequency (without accounting Turbo) 2294 MHz
CPU Multiplier 23x || Bus clock frequency (BCLK) 99.74 MHz
Socket [0] - [physical cores=4, logical cores=8, max online cores ever=4]
TURBO ENABLED on 4 Cores, Hyper Threading ON
True Frequency 2393.74 MHz (99.74 x [24])
Max TURBO Multiplier (if Enabled) with 1/2/3/4 Cores is 34x/33x/31x/31x
Current Frequency 3319.69 MHz [99.74 x 33.28] (Max of below)
Core [core-id] :Actual Freq (Mult.) C0% Halt(C1)% C3 % C6 % C7 % Temp
Core 1 [0]: 3199.58 (32.08x) 3.35 29.3 12 1.7 52.4 53
Core 2 [1]: 3319.69 (33.28x) 98.9 0 0 0 0 60
Core 3 [2]: 3166.42 (31.75x) 1.38 7.22 2.19 1 87.7 55
Core 4 [3]: 3130.44 (31.39x) 1 2.02 0 0 97.9 50
C0 = Processor running without halting
C1 = Processor running with halts (States >C0 are power saver)
C3 = Cores running with PLL turned off and core cache turned off
C6 = Everything in C3 + core state saved to last level cache
Above values in table are in percentage over the last 1 sec
[core-id] refers to core-id number in /proc/cpuinfo
'Garbage Values' message printed when garbage values are read
Ctrl+C to exit
|
Somebody knows what C7 does?
//edit:
Quote: | Core C7 State
Individual threads of a core can enter the C7 state by initiating a P_LVL4 I/O read to
the P_BLK or by an MWAIT(C7) instruction. The core C7 state exhibits the same
behavior as the core C6 state unless the core is the last one in the package to enter the
C7 state. If it is, that core is responsible for flushing L3 cache ways. The processor
supports the C7s substate. When an MWAIT(C7) command is issued with a C7s
sub-state hint, the entire L3 cache is flushed in one step as opposed to flushing the L3
cache in multiple steps. |
google link to pdf _________________ Gentoo on Uptime Project - Larry is a cow |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Yamakuzure Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/46484627558b6ccf846e49.jpg)
Joined: 21 Jun 2006 Posts: 2305 Location: Adendorf, Germany
|
Posted: Tue Sep 13, 2011 9:20 am Post subject: |
|
|
As I am traveling twice each day on pt working on my notebook, I have cpufreqd installed which switches between "performance" (AC plugged in, temperature normal), "conservative" (AC not plugged in or temperature too high) and "powersave" (Battery below 30%) for me. As it is an i7 cpu in my notebook, I have enabled the intel_idle driver and battery lasts for something between three and five hours, depending on how many compilation cycles (I am a software developer) I need while on battery. _________________ Edited 220,176 times by Yamakuzure |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|