Today was a pretty fun day. By God’s grace, I was able to add intelli_plug, a hotplug alternative made by Faux123, to my JFLTE kernel! Adding a hotplug was a lot easier than I thought it would be, and only required one trimming of the code by Faux123 to make it work on my kernel.
Some of you may wonder, well, what IS a hotplug? A hotplug is a controller that chooses how many of your cpu cores are going to be used at once. I know that sounds a lot like a governor, but a governor governs at what frequency the core(s) are used, and a hotplugger allows you to turn off cores that do not need to be utilized right now. This saves you battery life, and also helps to keep your phone or computer cool.
So, here’s what I did to make it work.
First, I added the intelli_plug.c file, which I found here:
I would recommend that you use mine however, as I had to ammend 2 lines to make it work with the JFLTE kernel.
Then, I added the appropriate lines to kconfig:
bool “Enable intelli-plug cpu hotplug driver”
Generic Intelli-plug cpu hotplug driver for ARM SOCs WJH 20161222
obj-$(CONFIG_INTELLI_PLUG) += intelli_plug.o
in the arch/arm/mach-msm folder.
Then I recompiled it. Note that I set the default option to “y”, so I didn’t need to add intelli_plug to my arch/arm/config/files, it simply is added by default to any kernel I build with that tree. On first run, there was an error on this line:
unsigned int avg_nr_run = avg_nr_running();
and This line:
if (avg_nr_run <= (nr_threshold << (FSHIFT – nr_fshift)))
but avg_nr_running() did not exist elsewhere in the kernel, so I commented these out with the double forward slash “//”. Normally, I would think it needs that, but in this case it still works okay. Upon rebuilding, it whent smoothly, and seems to work great!
Linux – keep it simple.