- A 20-year-old chipset workaround in the Linux kernel discovered by an AMD engineer, K. Prateek Nayak, is still causing performance issues.
- The patch was included as part of the “x86/urgent” fixes and is expected to be released in Linux kernel 6.0 on October 2.
- The patch note says, sampling certain workloads with IBS on AMD Zen3 system shows that a significant amount of time is spent in the dummy op.
K. Prateek Nayak, AMD engineer, revealed that a 20-year-old chipset workaround in the Linux kernel can still be applied to modern AMD processors. The workaround can reduce the performance of modern Zen processors. The workaround is now being fixed for old systems and it will also help with the performance of modern systems.
Merged for Linux 6.0
A patch is posted, enabling ACPI processors’ idle code to avoid a workaround on AMD Zen systems. ACPI support was initially added to the Linux kernel in 2002. The patch description says,
« The idle driver reads the acpi_gbl_FADT.xpm_timer_block.addressin the IOPORT based C-state exit path which is claimed to be a “Dummy wait op” and has been around since ACPI introduction to Linux dating back to Andy Grover’s Mar 14, 2002 posting. The comment above the dummy operation was elaborated by Andreas Mohr back in 2006 in commit b488f02156d3d (“ACPI: restore comment justifying ‘extra’ P_LVLx access”) where the commit log claims:
“this dummy read was about: STPCLK# doesn’t get asserted in time on (some) chipsets, which is why we need to have a dummy I/O read to delay further instruction processing until the CPU is fully stopped.” »
According to the patch notes, sampling certain workloads with IBS on the AMD Zen3 system shows that a significant amount of time is spent in the dummy op, which incorrectly gets accounted as C-State residency. A large C-State residency value can prime the cpuidle governor to recommend a deeper C-State during the subsequent idle instances, starting a vicious cycle, and leading to performance degradation on workloads that rapidly switch between busy and idle phases.
The AMD patch is now merged for Linux kernel 6.0 and is expected to be included in the next week’s release. The patch has also evolved into another patch, created by Intel Linux engineer Dave Hansen, which limits the “dummy wait” workaround to old systems.