If you have it in your motherboard BIOS (I have an Asus Prime X370 Pro motherboard) try and disable the C6 power functionality and set it from automatic to manual.

There are kernel options if you don't have the option in your BIOS/UEFI. Although you need to check if this is suitable for your kernel version because the later kernel versions have disabled some or all of this functionality (CONFIG_RCU_NOCB_CPU_ALL is reportably gone, but may be reintroduced by kernel debugging functionality: RCU_NOCB_CPU which should be enabled as should the RCU_EXPERT kernel option which enables RCU_NOCB_CPU - without these CPU options there can be no software workaround).

So in the kernel command line for 12 thread CPUs (If you cannot disable the C6 functionality in BIOS / UEFI):

rcu_nocbs=0-11

For 16 thread CPUs:

rcu_nocbs=0-15

Essentially, as I understand it Linux requests that the system reduces the voltage to the CPU too much and the motherboard will allow it to do so which results in Linux locking up.

Symptoms include: unresponsible keyboard / mouse input, whatever is on the screen freezes there, and the system is unresponsive to ssh, although will still ping. If there is sound playing then the last of the audio buffer will play out, repeat 2-3 times and then stop. There is nothing in /var/log/messages. This may happen once or twice a month. At totally unpredictable times - normally when I am surfing the net.

If you can, try to disable this in your motherboard BIOS / UEFI, as the hardware shouldn't allow the system to drop the power this low. The software kernel option is complicated, since it depends on kernel changes.

This issue has been bothering me for years, but i was too busy and it's not been frequent enough for me to spend time resolving it. This week after a 2.5 hour FSCK, i'd had enough. Since disabling the features in the UEFI, the problem hasn't recurred.