AMD CPUs are still affected by a 20-year-old Linux workaround

Why it matters: The Linux kernel contains an old trick to deal with potential incompatibilities in early ACPI implementations. Today, the trick isn’t needed and only makes things worse for AMD CPUs by hampering performance. A patch should arrive soon.

The incredibly successful Zen architecture turned the modern CPU market on its head, putting AMD at the forefront of the performance race and giving users a much-needed competitor for Intel’s long-lived run. However, there is one area of ​​computing where AMD CPUs still suffer from a performance hit – although there are no actual reasons to justify this state of affairs.

AMD CPUs will slow down when using a Linux-based operating system when they shouldn’t. The reason for this strange behavior dates back to 2002, when support for the Advanced Configuration and Power Interface (ACPI) standard was first added to the open-source kernel. Previous ACPI implementations had some compatibility issues, so developers had to expect some strange behaviors, such as: For example, chipsets may go into a hibernation mode a little later than expected.

The problem forced the above developers to introduce a “dummy wait operation” into the kernel, forcing a redundant data read before the CPU could fully stop using the STPCLK# instruction. The dummy wait-op was added to Linux in 2002 and is still present, although processors based on the Zen architecture no longer need the workaround.

Worst of all, the dummy wait operation slows down the CPU, as AMD engineer Prateek Nayak explained in a recent kernel patch: For certain workloads on Linux systems, Nayak said, “A significant amount of time is spent on the dummy operation erroneously counted as residing in the C-state.” C-states are an ACPI feature designed to save power when the CPU doesn’t need to stay awake, and the dummy waits can drive an AMD CPU even deeper into the C-state hierarchy, thus slowing their return to fully awake operation.

Testing different versions of the kernel (on a dual-socket Zen3 system), Nayak discovered that his patch to remove the dummy wait operation yielded a notable improvement in tbench performance – from a 1,390 percent increase in minimum MB/s throughput to an average 51 percent increase over the base kernel.

The decades-old code for ACPI compliance no longer needs to stay in Linux, so Nayak’s patch will likely be added to an upcoming version of the kernel — maybe even version 6.0, which is expected to ship next week just ahead of the introduction of the Rust programming language in Linux 6.1, as decided by Penguin Maximo Linus Torvalds.

On Intel processors, the dummy wait operation does not appear to be a performance issue, although an urgent patch has already been submitted. AMD CPUs are still affected by a 20-year-old Linux workaround

Chris Barrese

InternetCloning is an automatic aggregator of the all world’s media. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials, please contact us by email – The content will be deleted within 24 hours.

Related Articles

Back to top button