Tedium - It Came From an Old Patch 🐞

A 20-year-old Linux workaround returns to bite AMD.
Issue #258 • September 27, 2022 • By Ernie Smith • View on Web

It Came From an Old Patch 🐞

A decades-old workaround in the Linux kernel held back the full potential of modern AMD chips—until recently, when it was caught by AMD.

Today’s sponsor: Stacked Marketer is the free daily newsletter that gives marketers an edge on the competition in just 7 minutes a day. Covering breaking news, tips and tricks, and insights for all major marketing channels like Google, Facebook, TikTok, native ads, SEO and more. Join 32k+ marketers who read it daily.

(Ulleo/Pixabay)

Talk about technical debt. About two decades ago, processors sold by AMD needed a workaround to help support a then-new configuration standard called ACPI, or the Advanced Configuration and Power Interface. And that workaround turned into a major headache in the modern day.

On Linux circa 2002, AMD hardware needed a little help to support ACPI, so a technical workaround called a “dummy wait op” was added, which essentially waits for the CPU to complete a task entirely before shooting more instructions its way.

This was what was necessary to make single-core Athlon processors work well with Linux in 2002. But the problem is, we’re in a world where even low-end processors have a whole bunch of cores and can safely work around issues like this, with no problem. AMD just announced the seventh generation of Ryzen, and that, along with modern generations of EPYC and Threadripper, are still being held up by this dummy wait op, despite it not being a technical problem for the processor lines in years. While 2002-era Athlons had legitimate technical reasons why they needed it, we are not in 2002 anymore, and that “dummy wait op” is actually holding the chips back in certain cases.

As AMD engineer Prateek Nayak put it in a patch submission:

However, sampling certain workloads with IBS on 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, leading to performance degradation on workloads that rapidly switch between busy and idle phases.

So, depending on the task, to put it all another way, AMD chips have been getting slowed down significantly because of a presumption that was only true for only a short time but has been treated as true in the kernel code for decades.

Dave Hansen, an Intel employee who works closely on the Linux kernel, noted in his patch addition to the kernel that most modern systems do not actually need this workaround—and that Intel hasn’t needed it for years.

Zii miller kz2 Z3ma Va Lo unsplash

(Zii Miller/Unsplash)

“First and foremost, modern systems should not be using this code. Typical Intel systems have not used it in over a decade because it is horribly inferior to MWAIT-based idle,” he wrote. “Despite this, people do seem to be tripping over this workaround on AMD system today.”

Now, to be fair, Linux code is a complex beast, and it is often difficult to assess where legacy code may actually be hurting performance in certain cases. In this particular case, it took AMD a while to assess exactly where the holdup was coming from, and then what would be necessary to fix it.

Linux is great because of its broad support of platforms new and old, but the challenge is that these fixes intended for very old systems can creep out of the woodwork and create challenges for new ones. This is a 30-year-old code base, and sometimes getting it to fighting shape in 2022 means managing the technical debt of two decades ago.

Anyway, for AMD owners: Enjoy your faster performance on version 6.0 of the Linux kernel.

Related Reads:

Time limit given ⏲: 30 minutes

Time left on clock ⏲: 1 minute, 18 seconds

If you like this, be sure to check out more of my writing at Tedium: The Dull Side of the Internet.

Do you own a newsletter? Want to try your hand at writing an entire article in 30 minutes or less? If so, let’s do a swap—reply to this email to see about setting something up.

Dig this issue? Let me know! (And make sure you tell others about MidRange!)

Copyright © 2021-2022 Tedium, all rights reserved. No Elon Musks were involved in the making of this issue.

unsubscribe from this list | view email in browser | sent with Email Octopus

Older messages

A Quiet Odyssey 🕹️

Saturday, September 24, 2022

Why the Magnavox Odyssey² matters to gaming history. Here's a version for your browser. Hunting for the end of the long tail • September 24, 2022 Today in Tedium: The Magnavox Odyssey is one of the

USA Yesterday 🗞

Wednesday, September 21, 2022

Meet USA Today's first foray into the online landscape. Here's a version for your browser. Hunting for the end of the long tail • September 21, 2022 Today in Tedium: As I've made clear many

The Coronation Will Be Televised 👑

Saturday, September 17, 2022

Why Queen Elizabeth's coronation was almost banned from TV. Here's a version for your browser. Hunting for the end of the long tail • September 16, 2022 Hey all, Ernie here with a twist.

Riding for Your Life 🚲

Thursday, September 15, 2022

An up-close look at NYC's e-bike delivery culture. Here's a version for your browser. Hunting for the end of the long tail • September 14, 2022 Hey all, Ernie here with a fresh one from our man

The Execution of All Things 💾

Friday, September 9, 2022

Binary files we used to execute, but not anymore. Here's a version for your browser. Hunting for the end of the long tail • September 09, 2022 Today in Tedium: Whether the way you roll is .EXE, .

You Might Also Like

Youre Overthinking It

Wednesday, January 15, 2025

Top Tech Content sent at Noon! Boost Your Article on HackerNoon for $159.99! Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, January 15, 2025? The

eBook: Software Supply Chain Security for Dummies

Wednesday, January 15, 2025

Free access to this go-to-guide for invaluable insights and practical advice to secure your software supply chain. The Hacker News Software Supply Chain Security for Dummies There is no longer doubt

The 5 biggest AI prompting mistakes

Wednesday, January 15, 2025

✨ Better Pixel photos; How to quit Meta; The next TikTok? -- ZDNET ZDNET Tech Today - US January 15, 2025 ai-prompting-mistakes The five biggest mistakes people make when prompting an AI Ready to

An interactive tour of Go 1.24

Wednesday, January 15, 2025

Plus generating random art, sending emails, and a variety of gopher images you can use. | #​538 — January 15, 2025 Unsub | Web Version Together with Posthog Go Weekly An Interactive Tour of Go 1.24 — A

Spyglass Dispatch: Bromo Sapiens

Wednesday, January 15, 2025

Masculine Startups • The Fall of Xbox • Meta's Misinformation Off Switch • TikTok's Switch Off The Spyglass Dispatch is a newsletter sent on weekdays featuring links and commentary on timely

The $1.9M client

Wednesday, January 15, 2025

Money matters, but this invisible currency matters more. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

⚙️ Federal data centers

Wednesday, January 15, 2025

Plus: Britain's AI roadmap ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

Post from Syncfusion Blogs on 01/15/2025

Wednesday, January 15, 2025

New blogs from Syncfusion Introducing the New .NET MAUI Bottom Sheet Control By Naveenkumar Sanjeevirayan This blog explains the features of the Bottom Sheet control introduced in the Syncfusion .NET

The Sequence Engineering #469: Llama.cpp is The Framework for High Performce LLM Inference

Wednesday, January 15, 2025

One of the most popular inference framework for LLM apps that care about performance. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

3 Actively Exploited Zero-Day Flaws Patched in Microsoft's Latest Security Update

Wednesday, January 15, 2025

THN Daily Updates Newsletter cover The Kubernetes Book: Navigate the world of Kubernetes with expertise , Second Edition ($39.99 Value) FREE for a Limited Time Containers transformed how we package and