Ubuntu – intel_powerclamp: Start/Stop forced idle injection


I do not really knows when it started, i just upgraded from 13.10 to 14.04 and was about to do something about graphics performances (unity felt sluggish). That situation already lasted for 6 months I was paying attention to troubled nvidia proprietary drivers in sli configuration…
I was seriously pissed off on nvidia, unity and I was about to go for something non-unity related just go get smooth environment…

Then I discovered less then hour before I killed ubuntu/unity…

It is something related to intel_pstate…

I simply noticed, upon login performances are fantastics… Both cpu and gpu… Like a dream… Then after cca 10 seconds they drop and situation becomes ugly… I chased trough logs and found in syslog it seems to be related to this line:

Apr 28 21:29:41 b4da55 kernel: [ 83.861621] intel_powerclamp: Start idle injection to reduce power

After this line performances are gone. The session I'm having this one while writing this post is somewhat different… I was looking at Google to find how to tune or disable this idle injection (at least while I work on ac, not batteries) to get max performances but nothing… Then it happened on it's own, this line pop-up in syslog:

Apr 28 21:46:03 b4da55 kernel: [  362.386585] intel_powerclamp: Stop forced idle injection

I do not know what caused it… But now it works like a charm! It's so smooth… I can't believe… I guess it renders like over 100fps… I enabled wobbling window effect and having fun… htop is showing much lower cpu usage while i'm not doing anything…

Can someone tell me how I can control this idle injection?

Best Answer

Warning: check your CPU temperature. On my system, idle injection starts only when things get hot. The OS protects the hardware from overheating.

See intel_powerclamp manual. It has "Usage and Interfaces" section which describes how to control it.

TL;DR sudo rmmod intel_powerclamp, but you've been warned.

More gentle means to control the thing exist.

First, locate the abstract "thermal device" corresponding to the power consumption control loop:

# grep -l intel_powerclamp /sys/class/thermal/cooling_device*/type

# cd /sys/class/thermal/cooling_device11

Now, the "slowdown" percentage of the control loop can be adjusted:

# echo 25 > cur_state

It's possible to set 0 there. Percentage above 50 is not allowed.

It'd be great if someone came up with an applet for controlling this contraption easily (i.e. if someone added the obviously needed general user controls), perhaps with rules (AC/battery, time of day, screen idle etc).