Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 152810 - sys-power/cpufreqd: load/unload necessary modules
Summary: sys-power/cpufreqd: load/unload necessary modules
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2006-10-25 13:02 UTC by Daniel Franke
Modified: 2014-05-11 08:05 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
cpufreqd-conf.d (cpufreqd-conf.d,197 bytes, text/plain)
2007-05-17 08:41 UTC, Christian Heim (RETIRED)
Details
cpufreqd-init.d.patch (cpufreqd-init.d.patch,1.75 KB, text/plain)
2007-05-17 08:41 UTC, Christian Heim (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Franke 2006-10-25 13:02:29 UTC
[Follow-up to #152057]

Please introduce /etc/conf.d/cpufreqd where the user can list necessary modules, e.g.
$> cat /etc/conf.d/cpufreqd
MODULES="p4-clockmod cpufreq_ondemand"
(This would be somewhat similar to the module handling of lm_sensors.
Btw, sorry for the confusion I introduced in #152096.)

In addition, load the modules configured in /etc/conf.d/cpufreqd when starting /etc/init.d/cpufreqd, e.g.
$> diff -u cpufreqd.orig cpufreqd
--- cpufreqd.orig       2006-10-25 21:48:33.000000000 +0200
+++ cpufreqd    2006-10-25 21:31:48.000000000 +0200
@@ -31,6 +31,15 @@
 }

 start() {
+       if [ -f /proc/modules ] ; then
+               einfo "Loading cpufreqd modules..."
+               for module in ${MODULES} ; do
+                       ebegin "  Loading ${module}"
+                       modprobe ${module} 2> /dev/null
+                       eend ${?}
+               done
+       fi
+
        checkconfig || return 1

        ebegin "Starting CPU Frequency Daemon"

(diff against cpufreqd-2.2.0-r2)

At last, please find a way to properly unload any cpufreqd-related modules and stop frequency scaling alltogether. Currently, if cpufreqd is stopped, the corresponding modules are still in use and the currently active governor will continue to handle the scaling of frequencies.

Since `cpufreqd start` gets frequency scaling going, I expect `cpufreqd stop` to undo everything.
Comment 1 Christian Heim (RETIRED) gentoo-dev 2007-05-17 08:41:09 UTC
Created attachment 119502 [details]
cpufreqd-conf.d

(In reply to comment #0)
> [Follow-up to #152057]
> 
> Please introduce /etc/conf.d/cpufreqd where the user can list necessary
> modules, e.g.
> $> cat /etc/conf.d/cpufreqd
> MODULES="p4-clockmod cpufreq_ondemand"
> (This would be somewhat similar to the module handling of lm_sensors.
> Btw, sorry for the confusion I introduced in #152096.)
> 
> In addition, load the modules configured in /etc/conf.d/cpufreqd when starting
> /etc/init.d/cpufreqd, e.g.
> $> diff -u cpufreqd.orig cpufreqd

Daniel could you please try the attached file, and see if they work ?
Comment 2 Christian Heim (RETIRED) gentoo-dev 2007-05-17 08:41:29 UTC
Created attachment 119503 [details]
cpufreqd-init.d.patch
Comment 3 Daniel Franke 2007-05-17 19:04:34 UTC
I tried and it's not that simple. 

MODULES="p4_clockmod cpufreq_ondemand cpufreq_performance"

Shutting down:
 * Stopping CPU Frequency Daemon ...                                  [ ok ]
 * Unloading CPU Frequency scaling modules
 *   Unloading p4_clockmod ...                                        [ !! ]
 *   Unloading cpufreq_ondemand ...                                   [ !! ]
 *   Unloading cpufreq_performance ...                                [ ok ]

The modules p4_clockmod and cpufreq_ondemand are in use when attempting to unload them. As there is only one active governor at a time, unloading of cpufreq_performance succeeds:
Module                  Size  Used by
cpufreq_ondemand        6164  1
p4_clockmod             4756  1
speedstep_lib           3584  1 p4_clockmod
freq_table              3848  1 p4_clockmod

While there are tons of docs in the net how to enable frequence scaling, there seems to be not a single article that describes how to get rid of it ... (besides removing cpufreqd from the init scripts and rebooting).
Comment 4 Christian Heim (RETIRED) gentoo-dev 2007-05-17 19:20:10 UTC
(In reply to comment #3)
> I tried and it's not that simple. 
> 
> MODULES="p4_clockmod cpufreq_ondemand cpufreq_performance"
> 
> Shutting down:
>  * Stopping CPU Frequency Daemon ...                                  [ ok ]
>  * Unloading CPU Frequency scaling modules
>  *   Unloading p4_clockmod ...                                        [ !! ]
>  *   Unloading cpufreq_ondemand ...                                   [ !! ]
>  *   Unloading cpufreq_performance ...                                [ ok ]
> 
> The modules p4_clockmod and cpufreq_ondemand are in use when attempting to
> unload them. As there is only one active governor at a time, unloading of
> cpufreq_performance succeeds:
> Module                  Size  Used by
> cpufreq_ondemand        6164  1
> p4_clockmod             4756  1
> speedstep_lib           3584  1 p4_clockmod
> freq_table              3848  1 p4_clockmod
> 
> While there are tons of docs in the net how to enable frequence scaling, there
> seems to be not a single article that describes how to get rid of it ...
> (besides removing cpufreqd from the init scripts and rebooting).

Well, simply just put in the governor into MODULES, modprobe will take care of the dependency while loading and unloading.
Comment 5 Daniel Franke 2007-05-17 19:32:59 UTC
That's why I quoted the contents of the MODULES variable from /etc/conf.d/cpufreqd in comment #3:

MODULES="p4_clockmod cpufreq_ondemand cpufreq_performance"

Module                  Size  Used by
cpufreq_ondemand        6164  1
p4_clockmod             4756  1
speedstep_lib           3584  1 p4_clockmod
freq_table              3848  1 p4_clockmod

If you double check my last comment, you will see that unloading of p4_clockmod fails to begin with (cpufreqd is not running when issuing the comand below):

$>  modprobe -r p4_clockmod
FATAL: Module p4_clockmod is in use.

Comment 6 Pacho Ramos gentoo-dev 2012-11-18 11:58:20 UTC
An updated patch would be needed
Comment 7 Pacho Ramos gentoo-dev 2014-05-11 08:05:53 UTC
dropped