The Linux 6.0 kernel, which is set to be released next Monday, includes a change that addresses performance issues for systems using AMD Zen processors. The source of the performance drop was code added 20 years ago to bypass a hardware issue in certain chipsets. This hardware problem has long been resolved and does not manifest in current chipsets, but the old workaround was forgotten and became a source of performance decline in systems based on modern AMD CPUs. New systems with Intel CPUs are unaffected by the old workaround because they access ACPI through a separate intel_idle driver instead of the common processor_idle driver.
The workaround was added to the kernel in March 2002 to block the manifestation of an error in chipsets related to inadequate idle state handling due to delays in processing the STPCLK# signal. To work around the problem in ACPI implementation, an additional WAIT instruction was added, slowing down the processor so the chipset could transition to idle state. Profiling with Instruction-Based Sampling (IBS) on AMD Zen3 processors revealed that the CPU spends a significant amount of time executing this stub, leading to a misinterpretation of the CPU load state and deeper sleep states (C-States) being set by the cpuidle handler.
This behavior results in decreased performance in workloads that frequently alternate between idle and busy states. For example, using a patch that disables the workaround, the average tbench test scores increase from 32191 MB/s to 33805 MB/s.
Source: opennet.ru
