Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how should new cpupower be used
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ayvango
Tux's lil' helper
Tux's lil' helper


Joined: 08 Feb 2012
Posts: 118

PostPosted: Wed Sep 11, 2013 3:19 am    Post subject: how should new cpupower be used Reply with quote

I've read from several topics that cpufrequtils should be discarded for sake of cpupower utility. I've installed it and got some troubles.

There is no config file in /etc that describe cpupowerd behaviour like it was done by cpufreqd. Moreover the cpupowerd run-script in /etc/init.d just sets cpu frequency governor on the service spawning and stopping. It invokes no persistent daemons to watch for acpi events and temperature sensors.

So, how can cpupowerd be used in place of cpufreqd?
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Wed Sep 11, 2013 5:17 am    Post subject: Reply with quote

cpufrequtils and cpupower just set the cpu frequency scaling policy on the start and stop of the service. They do not do anything else. They do not have a background daemon. Their configuration file is in /etc/conf.d directory.

cpufreqd is a daemon who can change the cpu frequency scaling policy according to it's configuration file /etc/cpufreqd.conf. cpufrequtils, cpupower and cpufreqd have to be install separately, cpufrequtils and cpupower conflicting each other.
_________________
Paul
Back to top
View user's profile Send private message
ayvango
Tux's lil' helper
Tux's lil' helper


Joined: 08 Feb 2012
Posts: 118

PostPosted: Wed Sep 11, 2013 5:51 am    Post subject: Reply with quote

So, should I keep using cpufreqd with newest kernels?
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Wed Sep 11, 2013 7:34 am    Post subject: Reply with quote

It's depend of what you want. I do not see a big difference between cpupower and cpufrequtils. If you want a fine tune of the CPU according to events you can use cpufreqd. I stop using it since a couple of years. I only switch between ondemand and performance frequency scaling policie from time to time.

For a laptop you can use laptop-mode-tools. Some CPU setup can be done via the ACPI subsystem too.
_________________
Paul
Back to top
View user's profile Send private message
FaeLLe
n00b
n00b


Joined: 13 Aug 2007
Posts: 13
Location: London

PostPosted: Sun Apr 06, 2014 4:48 pm    Post subject: Reply with quote

cpufreqd is now masked and will be removed in a month.

Any recommendations on how cpupower can be used a deamon to dynamically scale CPU frequencies?
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6097
Location: Dallas area

PostPosted: Sun Apr 06, 2014 4:54 pm    Post subject: Reply with quote

I've just started using the freq govs. I installed ondemand, and it seems to be working pretty well.

I have conky set up to monitor each cpu core freq and the Vcore for the cpu.

Ramps up and down smoothly, both for video and compiling, as the freq drops the Vcore power drops correspondingly with it.

Unless you have some special needs I would just use ondemand and see how it works.
As Logicien said compile the performance gov and if needed swap to it.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
FaeLLe
n00b
n00b


Joined: 13 Aug 2007
Posts: 13
Location: London

PostPosted: Sun Apr 06, 2014 6:08 pm    Post subject: Reply with quote

So if I understand correctly the governor should be able to manage the CPU frequency scaling and there should be no need for any third party tools (unless any special needs exist). Is this correct?
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sun Apr 06, 2014 9:37 pm    Post subject: Reply with quote

FaeLLe wrote:
So if I understand correctly the governor should be able to manage the CPU frequency scaling and there should be no need for any third party tools (unless any special needs exist). Is this correct?

FaeLLe ... correct, infact if you use cpufreqd/cpufrequtils with > 3.7.x you may find the load average becomes somewhat high due (I think) to them being unaware of the changes made when cpupower was introduced.

With cpupower you can still set 'up_threshold', ' sampling_down_factor', 'ignore_nice_load', etc, via the SYSFS_EXTRA variable in /etc/conf.d/cpupower, but there is no facility (as with cpufreqd) to alter the freq based on the application used ... but that shouldn't be necessary anyhow.

best ... khay
Back to top
View user's profile Send private message
v_2e
n00b
n00b


Joined: 28 Dec 2008
Posts: 21

PostPosted: Mon Apr 07, 2014 2:50 pm    Post subject: Reply with quote

Is there a way to perform the CPU governor (or maximum frequency) change depending on the CPU temperature with some tools other than cpufreqd?
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3595

PostPosted: Tue Apr 08, 2014 3:14 pm    Post subject: Reply with quote

Hi dear all,

Same question here, as we have 27°C 6:30 AM ...
We're on a rolling out compiling distro, remember?
Not to mention a possibly warming up world?

Thks for your attention.


Last edited by CaptainBlood on Wed Apr 09, 2014 4:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Tue Apr 08, 2014 5:53 pm    Post subject: Reply with quote

v_2e, CaptainBlood ...

It somewhat depends on the cpufreq driver used ... if intel_pstate is used then thermald may work. Also disabling 'turbo' via /sys/devices/system/cpu/intel_pstate/no_turbo will help keep the temp down.

Otherwise, might look under /sys/devices/system/cpu and see what features the driver provides ...

best ... khay
Back to top
View user's profile Send private message
lexflex
Guru
Guru


Joined: 05 Mar 2006
Posts: 363
Location: the Netherlands

PostPosted: Tue Apr 08, 2014 6:02 pm    Post subject: Reply with quote

CaptainBlood wrote:

Same question here, as we have 27° C 6:30 AM ...
We're on a rolling out compiling distro, remember?
Not to mention a possibly warning up world?


Lol misread three times due to the typo, but it seems the warming up is slow enough for any important new packages regarding temperature-monitoring to be developed, introduced in portage, and for any monthly emerge --sync to catch up with the changes ;-)
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3595

PostPosted: Wed Apr 09, 2014 5:13 pm    Post subject: Reply with quote

Hi dear all,

I've been on cpufreqd for ages now, coz it allows to cap freq according to temp.
And since I moved to where I'm now, I experience shutdown du to overheat detection :

Xen dom0 and un to for domUs are making a fool out of me when competing with my daily simulatenous eix-sync && emerge -uDN world syndroma on my laptop.


khayyam : I thought p-state was obsolete (depreciated). Pardon me if I"m wrong. Anyhow will investigate accordingly. Thks

By the way I run on a Intel Core 2 Duo SU9400 / 1.4 GHz (plz stop laughing). Distcc in configured but untested yet due to lack of HW.

Bye RvryBudy and thanks for your attention.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Wed Apr 09, 2014 6:37 pm    Post subject: Reply with quote

CaptainBlood wrote:
I've been on cpufreqd for ages now, coz it allows to cap freq according to temp.

CaptainBlood ... well, before I switched from cpufreqd to cpupower (this was round about the same time as cpupower was introduced in the kernel) I experienced very weird behaviour with cpufreqd (heavy load ... due I think to it polling parts of cpufreq which had changed) ... this may have been a bug, I can't say, but I stopped using it for that reason. As always, YMMV.

CaptainBlood wrote:
khayyam : I thought p-state was obsolete (depreciated). Pardon me if I"m wrong. Anyhow will investigate accordingly.

No, "intel_pstate" is that used for processors such as 'Sandy bridge' ...

kernel config wrote:
CONFIG_X86_INTEL_PSTATE: This driver provides a P state for Intel core processors. The driver implements an internal governor and will become the scaling driver and governor for Sandy bridge processors.

kernel config wrote:
By the way I run on a Intel Core 2 Duo SU9400 / 1.4 GHz (plz stop laughing).

In which case you're probably using X86_ACPI_CPUFREQ (acpi-cpufreq) which is also a "p-states" driver. I am too (T2500 @ 2.00GHz ... which isn't even a core2), and no thermal control is provided ... you should take a look in /sys/devices/system/cpu/cpufreq/<governor>.

BTW, I'm surprised you can run virtualisation with such a processor ...

best ... khay
Back to top
View user's profile Send private message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 916

PostPosted: Wed Apr 09, 2014 10:26 pm    Post subject: Reply with quote

The whole cpufreqd/cpufrequtils/cpupower situation is quite unsatisfactory for mate users. How can we solve this conundrum?
Code:

# emerge -upDN world

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] sys-power/cpufrequtils-008-r4  USE="nls -debug"
[ebuild  N     ] app-text/gnome-doc-utils-0.20.10-r1  PYTHON_TARGETS="python2_7 -python2_6"
[ebuild  N     ] gnome-extra/yelp-xsl-3.10.1
[ebuild  N     ] dev-util/gtk-doc-1.20  USE="-debug -doc -emacs -highlight {-test} -vim" PYTHON_SINGLE_TARGET="python2_7 -python2_6" PYTHON_TARGETS="python2_7 -python2_6"
[ebuild  N    ~] mate-base/mate-applets-1.6.1  USE="networkmanager policykit -ipv6"
[blocks B      ] sys-power/cpufrequtils ("sys-power/cpufrequtils" is blocking sys-power/cpupower-3.13)

 * Error: The above package list contains packages which cannot be
 * installed at the same time on the same system.

  (sys-power/cpufrequtils-008-r4::gentoo, ebuild scheduled for merge) pulled in by
    sys-power/cpufrequtils required by (mate-base/mate-applets-1.6.1::mate-overlay, ebuild scheduled for merge)

  (sys-power/cpupower-3.13::gentoo, installed) pulled in by
    sys-power/cpupower required by @selected


For more information about Blocked Packages, please refer to the following
section of the Gentoo Linux x86 Handbook (architecture is irrelevant):

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?full=1#blocked
#
Back to top
View user's profile Send private message
Logicien
Veteran
Veteran


Joined: 16 Sep 2005
Posts: 1555
Location: Montréal

PostPosted: Thu Apr 10, 2014 1:35 am    Post subject: Reply with quote

Cpufrequtils and Cpupower cannot be installed at the same time. You have to choose between one of the two. Only gkrellm-cpufreq depend on Cpufrequtils. So if you do not use this Gkrellm plugin you can switch between Cpupower and Cpufrequtils by unmerge one and emerge the other.

For the moment, I do not see any other package than Cpufreqd who can set the cpu frequency and governor according on the temperature of the processor. It is very usefull with Amd processors to prevent preventive shutdown due to overheating. Maybe laptop-mode-tools can. I haven't use it since long.
Code:
equery d cpufreqd cpufrequtils cpupower
 * These packages depend on cpufreqd:

 * These packages depend on cpufrequtils:
x11-plugins/gkrellm-cpufreq-0.6.1 (sys-power/cpufrequtils)

 * These packages depend on cpupower:

_________________
Paul
Back to top
View user's profile Send private message
Princess Nell
l33t
l33t


Joined: 15 Apr 2005
Posts: 916

PostPosted: Thu Apr 10, 2014 8:36 pm    Post subject: Reply with quote

The point of my posting was to show that mate-applets has a dependency on cpufrequtils.

Maybe there should be a virtual for it.
Back to top
View user's profile Send private message
energyman76b
Advocate
Advocate


Joined: 26 Mar 2003
Posts: 2048
Location: Germany

PostPosted: Sun Apr 13, 2014 9:12 pm    Post subject: Reply with quote

FaeLLe wrote:
So if I understand correctly the governor should be able to manage the CPU frequency scaling and there should be no need for any third party tools (unless any special needs exist). Is this correct?


correct for many, many years.
_________________
Study finds stunning lack of racial, gender, and economic diversity among middle-class white males

I identify as a dirty penismensch.
Back to top
View user's profile Send private message
netixen
n00b
n00b


Joined: 26 Sep 2013
Posts: 31

PostPosted: Sun Apr 13, 2014 9:41 pm    Post subject: Reply with quote

There is a big difference in how the on-demand governor works on different cpus.
For instance some mobile cpus can only step up/down in to 3 frequencies (e.g 1200Mhz 2000Mhz 2200Mhz) while desktop cpus in to more or even step up/down through small steps +/- 10Mhz.
So the on-demand governor can deal with the performance management well but if you have thermal issues you will need to manage it from user-space.

I have written a user-space governor that monitors the thermal zones and adjusts the frequency when trip points are triggered. But I've only tested it on my own machines so it's not ready for the wild.
However if your system is about to catch on fire feel free to give me a shout.
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3129

PostPosted: Mon Apr 14, 2014 9:15 pm    Post subject: Reply with quote

Some procesors are said to be working better with conservative governor rather than on-demand. I think conservative is better for AMD CPUs and perhaps mobile CPUs. Purpose is the same as on-demand.
Never bothered to verify though, so well, just sain'.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6097
Location: Dallas area

PostPosted: Mon Apr 14, 2014 10:53 pm    Post subject: Reply with quote

From linux/Documentation/cpu-freq/governors.txt

The CPUfreq governor "ondemand" sets the CPU depending on the
current usage. To do this the CPU must have the capability to
switch the frequency very quickly.
---
The CPUfreq governor "conservative", much like the "ondemand"
governor, sets the CPU depending on the current usage. It differs in
behaviour in that it gracefully increases and decreases the CPU speed
rather than jumping to max speed the moment there is any load on the
CPU.
This behaviour more suitable in a battery powered environment.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
defer-
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jun 2007
Posts: 140
Location: Finland

PostPosted: Mon Apr 14, 2014 11:02 pm    Post subject: Reply with quote

I have heard that ondemand saves more power than conservative in real word situations. Ondemand finishes tasks more quickly and cpu can go to sleep state more quickly.
_________________
https://github.com/defer-
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Mon Apr 14, 2014 11:18 pm    Post subject: Reply with quote

defer- wrote:
I have heard that ondemand saves more power than conservative in real word situations. Ondemand finishes tasks more quickly and cpu can go to sleep state more quickly.

Indeed. That help text for the conservative governor is severely outdated. Race-to-idle is the game nowadays, and conservative completely screws with that. Power saving mostly comes from C-states, not P-states. Even ondemand is outdated in this regard, its constant P-state switching is superfluous. In deep C states, the frequency is 0 anyway, only in the C0 state is the frequency at the one determined by the P-state. That's why Intel developed the intel_pstate driver, which pretty much only switches P-states to handle turbo modes.

Required reading for everyone, it explains in more detail how modern processors work: https://plus.google.com/114657443111661859546/posts/dLn9T4ehywL
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum