[SOLVED] kicker / kima has many interrupts

Tue, 13 Oct 2015 (tags:linux, powersave)

The problem

When trying to lower power consumption on my Debian8 laptop I was paying closer attention at powertop and noticed that kicker has too many interrupts. CPU being constantly waked up will not allow the CPU longer stay in deeper C sleep modes. First I cleaned all unnecessary applets like docker and some other. And then remove interrupt events  from applets I want to continue to use. In this post I will focus on kima, I tackled with 3 approaches:

  1. Remove unnecessary sensors, it's handy to have battery charge meter and all aux information, but after all I can have battery readout from kpowersave, My system found many temperature sensors, it's nice to have so many of them, but in practice, I don't know even where they are located and what they are monitoring. Or I don't need them, after upgrading to SSD I don't need to watch HDD temperatures, ended up with 3 important temperatures (CPUs combined, ATI gpu, battery temperature). If my understanding of the source code is correct, each sensor even from same driver will case separate fetch call (in case of sensing frequency on a multi core CPUs will case separate fetch for each core)
     
  2. Increase sleep times for each source, for example updating uptime is with 30s intervals, even 120s should be grand. Battery refreshes every 5s (10s should be grand). Acpi thermal is 1s and maybe 5s or 10s should be grand, it doesn't sound as much, multiply it by dozens of sensors for each source and it will add up. Majority of sources have 1s refresh time where probably only cpu frequency is the only from 15 sources which really needs it. Then recompile package
     
  3. Remove unnecessary sources completely from the code so you will not be tempted to enable them again. Do you need to have uptime displayed on your laptop desktop environment? I disabled 12 sources, almost all except IbmAcpiThermalSrc, IbmAcpiFanSrc and SysFreqSrc. Added not into authors page to know it's my modified version (in case I will upgrade version of desktop environment, this way it will quickly show me if i'm running my modified version). Recompiled package.


Download

For people who like download binaries from unknown sources here is compiled package and source folder used for this build.

kima-trinity14.0.1pre3-0debian8.0.00amd64.deb

kima-modified-source.zip

 

Building own package

This went surprising well. I'm using Debian 8 with Trinity (kde 3.5) as desktop environment. Getting sources and build dependancies ready for compilation:

apt-get source kima-trinity
sudo apt-get build-dep kima-trinit
Then modifying sources is simple as well, all the sensor sources are in src/source. Opening one by one and modified all calls of mTrigger(this) which is default 1s sleep into mTrigger(this,5000) for 5s (or different sleep times if desired).
 
To remove specific source from application I modified src/kima.cpp where just commenting out desired sources i.e:
 
addSources(UptimeSrc::createInstances(this));
 
Adding custom line to the about page can be done with
 
 aboutData->addCredit("Trimmed custom build");
 
Now when ready for compilation, just run
 
dpkg-buildpackage -rfakeroot -b -nc -uc -us
 
The -us (do not sign the source) is probably not necessary, because with -b we are building only the binary anyway. This will build your own package and with this command you can install it into your system:
 
sudo dpkg -i kima-trinity_14.0.1~pre3-0debian8.0.0+0_amd64.deb
 
Enjoy your less power hungry applet.