Intel Idle State – How to Set intel_idle.max_cstate=1

idleintel

How can i set intel idle max cstate to 1 and how can i check when it will done. i have a freeze problem because of bay trail cores.

i tried kernel 4.5 4.1.12 4.4 but freeze problem still continue.
at the moment 4.4 is my kernel version.

Best Answer

If using GRUB:

With sudo, edit /etc/default/grub and edit the GRUB_CMDLINE_LINUX_DEFAULT line adding intel_idle.max_cstate=1 to whatever might already be there. After saving the file run sudo update-grub, then re-boot. Suggest that you save a copy of your original grub file first.

To check that your cstate is not going deeper than 1 use turbostat (package: linux-tools-common).

Example (where there is already something on the GRUB_CMDLINE_LINUX_DEFAULT):

Before (edited):

$ sudo turbostat -S --debug sleep 10
 Avg_MHz   %Busy Bzy_MHz TSC_MHz     SMI  CPU%c1  CPU%c3  CPU%c6  CPU%c7 CoreTmp  PkgTmp Pkg%pc2 Pkg%pc3 Pkg%pc6 PkgWatt CorWatt GFXWatt
       1    0.04    1654    3411       0    0.12    0.03   99.82    0.00      29      29    0.07    0.03   99.51    3.85    0.20    0.23
10.001629 sec

Make the change (using my method for configuration control):

~/config/etc/default$ cp /etc/default/grub ./
~/config/etc/default$ cp grub grub.original
~/config/etc/default$ nano grub

Change this:

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1"

To this:

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 intel_idle.max_cstate=1"

And update:

~/config/etc/default$ sudo cp grub /etc/default
~/config/etc/default$ sudo update-grub
~/config/etc/default$ sudo reboot -r now

Now check (edited):

$ sudo turbostat -S --debug sleep 10
 Avg_MHz   %Busy Bzy_MHz TSC_MHz     SMI  CPU%c1  CPU%c3  CPU%c6  CPU%c7 CoreTmp  PkgTmp Pkg%pc2 Pkg%pc3 Pkg%pc6 PkgWatt CorWatt GFXWatt
       0    0.02    1920    3411       0   99.98    0.00    0.00    0.00      39      39    0.00    0.00    0.00   10.49    6.66    0.23
10.001079 sec

Your should also see these messages in dmesg and var/log/kern.log (edited):

~$ dmesg | grep intel_idle
[    1.019709] intel_idle: max_cstate 1 reached

$ grep intel_idle /var/log/kern.log
Mar 23 08:10:32 s15 kernel: [    1.019709] intel_idle: max_cstate 1 reached