Comment 516 for bug 1690085

Revision history for this message
In , kernel (kernel-linux-kernel-bugs) wrote :

The root cause of the "freeze when idle" appears to be a fault in the mechanism which wakes the CPU up once it has gone into the deepest of deep sleeps.

Mr AMD has pointed the finger at PSUs which fail to maintain the correct voltage when the current draw approaches 0A. Between the PSU and the CPU there is circuitry on the motherboard, which I guess could also be involved ?

Disabling C-States, in particular C6, obviously addresses the apparent root cause.

However, for my machine, setting C6 Package Disabled (using zenstates.py) was not enough. Nor was it enough to set both C6 Package and C6 Core Disabled.

After setting "Typical Current Idle", I have had ~5 months without a "freeze when idle" -- with various kernels up to and including 4.18.9, and (latterly) with no other settings.

So I assume that "Typical Current Idle" does something more than disabling C6... something I have yet to discover.

------------

What the "Typical Current Idle" option does is secret :-(

On my machine (Ryzen 7 1800X, Asus X370-Pro, BIOS 4012), zenstates.py tells me:

   Low Current Idle : C6 Package Enabled : C6 Core Enabled
   Typical Current Idle : C6 Package Disabled : C6 Core Enabled
   Auto : C6 Package Enabled : C6 Core Enabled

and all three have the same three P-States:

   P0: FID=90 DID=8 VID=20 Ratio=36.00 vCore=1.35000
   P1: FID=80 DID=8 VID=2C Ratio=32.00 vCore=1.27500
   P2: FID=84 DID=C VID=68 Ratio=22.00 vCore=0.90000

[I thought that "Typical Current Idle" might be fiddling with P2, but that does not seem to be the case.]

I imagine there are many more parameters I could look at, if only I knew more. For completeness, I leave all other BIOS options in their default state.

While I was checking the effect of the "Current Idle" options, I noticed something peculiar about setting "Typical Current Idle". I started with:

 0) "Typical Current Idle" was: C6 Package Disabled

and then:

 1) reboot into BIOS, set "Low Current Idle", gave: C6 Package Enabled
 2) reboot into BIOS, set "Typical Current Idle", gave: C6 Package Enabled !
 3) shutdown and restart, gave: C6 Package Disabled !

To get the (full) effect of "Typical Current Idle" I have to do a cold boot, apparently !! [I tried this three times, just to be sure.]

------------

I'm curious about "idle=nomwait". I find this will "disable mwait for CPU C-states". AFAIKS, the MWAIT instruction halts the current thread and sets a given C-State to drop into. So not using MWAIT looks like another way of disabling C6 for the core ? Or is there something else going on here ?

Given that I found that disabling C6 is not enough to eliminate "freeze when idle", I would not expect "idle=nomwait" to be enough. Unless "idle=nomwait" does something more... avoiding a Kernel bug, for example ?