Linux – How to add CPU frequency governors to the Linux kernel

cpu-frequencylinuxlinux-kernel

CPU frequency scaling in Linux is by default performed via a governor, which as far as I know is included in the kernel. So far, on PC/server Linux kernels I've only seen the userspace, powersave, performance, ondemand and conservative governors. However, on custom Android ROMs and kernels I've seen many other better governors, such as pegasusq (CyanogenMod), zzmoove (Boeffla Kernel), lulzactiveq (Googy Max Kernel) and devilq (Devil2 Kernel).

Would it be a good idea to use a cell phone frequency governor on a laptop? And if so, how could I possibly add them to my Linux kernel? I use Gentoo so I'm already used to compiling my kernel if necessary.

Best Answer

You'll have to find the code for that specific governor and add it to your kernel before recompiling it or you can also write the proper Makefile and compile the governor as a module. The code for the governor should be in drivers/cpufreq/. For example, for the lulzactive governor: drivers/cpufreq/cpufreq_lulzactive.c

Related Question