How to set intel_idle.max_cstate=1

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.

1

4 Answers

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
4

After having the same freeze-problems with linux and my asrock Q2900 I found on a German IT website the solution/workaround provided by Intel. () There is a general problem with Bay-Trail-SoCs from Intel. The link to the patch:

Further information: This patch/script does obtain the power saving mode. The topic-solution above does remove this mode at all.

1

Edit /etc/defaults/grub:

GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=1"

Run

update-grub
shutdown -r now

There is no need to update grub anymore if you switch to a most recent kernel.

According to comment# 1013 in bug report it is now fixed:

I haven't checked this thread in a long time, but I thought I should post my findings just in case it is of any use to anyone.

A low end computer powered with an Intel N2807 which never worked more than 30 mn without crashing when I didn't set ...max_cstates=1 now works perfectly well with a stock kernel v. 5.3.1 or 4.19.75. I ran it for a couple of days with each version without any issues. The average power consumption was also down by a little over 10%.

It has taken about four years to fix this bug first reported December 8, 2015.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like