FS#56403 - [linux] Ryzen random freezes

Attached to Project: Arch Linux
Opened by rainer (raneon) - Tuesday, 21 November 2017, 20:12 GMT
Last edited by Eli Schwartz (eschwartz) - Sunday, 11 March 2018, 03:56 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To Tobias Powalowski (tpowa)
Jan Alexander Steffens (heftig)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Description: Random system freezes during normal work with AMD Ryzen 7 1700

Additional info:
* linux 4.13.11

Steps to reproduce:
During normal usage of my system I do get random freezes with my AMD Ryzen 7 1700. I need to hard reset the system. I cannot use the TTY or keyboard to reboot. I switched to linux-git to test if this is solved upstream, but until now it is not fixed.
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Sunday, 11 March 2018, 03:56 GMT
Reason for closing:  Fixed
Additional comments about closing:  linux 4.15
Comment by loqs (loqs) - Tuesday, 21 November 2017, 21:28 GMT
If Arch is not responsible for a bug, the problem will not be solved by reporting the bug to Arch developers.
You believe the issue is caused packaging or integration of linux package not upstream?
Comment by rainer (raneon) - Wednesday, 22 November 2017, 08:56 GMT
I think it doesn't matter what I believe. If I knew whom to blame I would do. I found the following bug while further investigating this issue: https://bugzilla.kernel.org/show_bug.cgi?id=196683. Reading the comments I cannot tell you whether this bug will be solved upstream or not. I cannot even tell you, if Ryzen users need to apply a workaround that is probably accidentally used in another distribution. I did open this bug because I guess I'm not the only Arch Linux user with a Ryzen CPU, I don't know how to fix this and I hope maybe somebody else knows what to do.
Comment by Sergio Correia (sergio.correia) - Monday, 18 December 2017, 15:38 GMT
You could try using this kernel: https://aur.archlinux.org/packages/linux-ryzen-git

I haven't tested it myself yet, as I am still waiting for AMD to ship a replacement CPU, as mine was plagued with the segfaults. That kernel does enable CONFIG_RCU_NOCB_CPU, enabling you to pass "rcu_nocbs=0-x" as a boot parameter (replace x with the number of threads-1; eg: for ryzen 5 1600, 12 threads, x = 11; for ryzen 7 1700, 16 threads, x = 15, etc).

Assuming this does work, it might be interesting if the default Arch kernel enabled that option as well, so that people with Ryzen cpus wouldn't need to use a custom kernel for this (hopefully temporary) workaround.
Comment by rainer (raneon) - Friday, 19 January 2018, 11:36 GMT
I replaced my Ryzen as well after too many segfaults. Ok, after testing this build now for one week, it seems to fix the random freezes when idle or on low load. With the standard kernel and Linux-git I had at least once per day a freeze, this is gone now. Thanks for providing this Aur package.
Comment by Sergio Correia (sergio.correia) - Thursday, 01 February 2018, 16:12 GMT
the regular "linux" package (4.15-1, currently in [testing]) enables CONFIG_RCU_NOCB_CPU (thanks @heftig), so you could give it a try as well.
Comment by rainer (raneon) - Saturday, 10 March 2018, 19:30 GMT
The regular linux 4.15 package works for me as well and the issue of random/frequent freezes is solved by the new kernel build and the kernel parameter.