Make cpufreqd work as module in Gentoo

I’m using the default setting via genkernel to build my box. But the cpufreqd always shown it cannot be start-up without the kernel config CONFIG_CPU_FREQ.

But the weird thing is: I’ve selected the CPU_FREQ* settings in my kernel and there are corresponding modules in /lib/modules/<kernel version>:/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
CONFIG_CPU_FREQ_STAT=m
CONFIG_CPU_FREQ_STAT_DETAILS=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
...

Finally, I found the reason: the modules (also the government settings) not be auto-loaded when booting. So I append the configuration for module auto-load for gentoo and everything works fine.

1. The final kernel configuration, I’ve change the default government setting from performance to userspace which make me can choose the speed I want:

1
2
3
4
5
6
7
8
9
10
11
12
13
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=m
CONFIG_CPU_FREQ_STAT=m
CONFIG_CPU_FREQ_STAT_DETAILS=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=m
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=m
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m

2. The auto-load module settings in gentoo (/etc/conf.d/module):

1
modules_3_0="acpi-cpufreq cpufreq_ondemand cpufreq_powersave cpufreq_conservative"

Which will load the INTEL’s CPUFREQ driver (acpi-cpufreq) and the governments.
Note: The governments which is loaded can be used in the programs (eg: Gnome’s CPU Frequency Scaling Monitor).
Note: the modules should be set AT LEAST major AND minor number of kernel (eg: 3.0 as 3_0) or it cannot be parsed.

Finally, everything works fine. Enjoy it. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *