Minutes-Long Boot Delays on AMD Zen CPUs Patched in Linux 6.13

Minutes-Long Boot Delays on AMD Zen CPUs Patched in Linux 6.13

Linux AMD patch fixes glacial boot speeds for some Zen 1 and 2 PCs, with time saved ranging from seconds to multiple minutes.

An issue that occasionally caused startup times on AMD Zen 1 and Zen 2 systems to exceed several minutes was fixed today in the Linux 6.13 kernel (via Phoronix).

While Linux can take a long time to boot on old hardware (almost five days for the antiquated Intel 4004), it is not a notoriously slow operating system. Even an August optimization that reduced boot time by 0.035 seconds was deemed notable, given that Linux is already a highly streamlined operating system.

However, four weeks ago, a Nokia employee noted that more than ten AMD servers running Zen 1-based Epyc CPUs were taking longer to boot up.

“Normally, that trace [a step of the booting process] would be at about 12 seconds with only 1-2 seconds variation across boots. But when applying the mentioned patch, the variation increases,” the Nokia engineer wrote in an email to an AMD employee and the Linux kernel team. “Most boots see no impact, on some boots the time is increased by a few to tens of seconds, and in extreme cases even by several minutes (!).”

The engineer also concluded that the problem stemmed from a patch made to Linux 6.11 in May 2023. Called “load late on both threads,” this was designed to solve microcode updates for AMD CPUs with simultaneous multi-threading (SMT), which includes nearly all Zen-based CPUs since 2017. SMT provides each core with two threads, hence the “both threads” component of the patch.

According to the AMD employee who authored the “both threads” function, Linux originally tested whether a given microcode update could be applied to only one thread or both threads. However, their fix deleted this check, ensuring that future microcode modifications would always apply to both threads.

However, the Nokia engineer argued that microcode changes would be successfully applied to one thread before being applied to the other, despite the fact that this was unnecessary and resulted in significantly longer boot times.

“It is claimed that the added late loading does no harm on any CPU newer than Bulldozer. Yet, based on my observations, I think this statement may be incorrect,” the Nokia employee wrote in an email to the AMD engineer who wrote the “both threads” patch. Not even a full month later, the engineer submitted a patch to the 6.13-rc1 kernel today that fixes the issue by flushing microcode updates out of the CPU’s memory buffer, preventing the update from going through a second time.

According to Phoronix, this patch should be backported to previous stable Linux kernel releases, allowing distros running pre-6.13 kernels to obtain the fix for poor boot times on AMD’s early Zen cores.

Given that the vulnerability was just discovered this month, despite having existed for almost a year, it’s unlikely that it affected many users or organizations. That’s not surprising given that the initial Zen CPUs debuted in 2017 and Zen 2 processors appeared in 2019; at this moment, very few machines still use these rather ancient CPUs.

Saundra Wedge

Saundra Wedge

Saundra Wedge is a news reporter at MCHS. She has expertise in covering a wide range of topics and is a professional news reporter. She strives to inform the public about significant news. She covers national, weather and tech news.

Leave a Reply

Your email address will not be published. Required fields are marked *