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

What Investors Want From AI Startups in 2025

Monday, November 25, 2024

Top Tech Content sent at Noon! How the world collects web data Read this email in your browser How are you, @newsletterest1? 🪐 What's happening in tech today, November 25, 2024? The HackerNoon

GCP Newsletter #426

Monday, November 25, 2024

Welcome to issue #426 November 25th, 2024 News LLM Official Blog Vertex AI Announcing Mistral AI's Large-Instruct-2411 on Vertex AI - Google Cloud has announced the availability of Mistral AI's

⏳ 36 Hours Left: Help Get "The Art of Data" Across the Finish Line 🏁

Monday, November 25, 2024

Visual Capitalist plans to unveal its secrets behind data storytelling, but only if the book hits its minimum funding goal. View Online | Subscribe | Download Our App We Need Your Help Only 36 Hours

DeveloPassion's Newsletter #180 - Black Friday Week

Monday, November 25, 2024

Edition 180 of my newsletter, discussing Knowledge Management, Knowledge Work, Zen Productivity, Personal Organization, and more! Sébastien Dubois DeveloPassion's Newsletter DeveloPassion's

Meet HackerNoon's Latest Features: Boost Stories with Translations, Speech-to-Text & More

Monday, November 25, 2024

Hey, Hacker! HackerNoon's monthly product update is here! Get ready for a new version of the mobile app, more translation developments, a new AI Gallery, backend moves, and more! 🚀 This product

The ultimate holiday gadget gift

Monday, November 25, 2024

AI isn't hitting a wall; $70 off Apple Watch; 60+ Amazon deals -- ZDNET ZDNET Tech Today - US November 25, 2024 Meta Quest 3S Why the Meta Quest 3S is the ultimate 2024 holiday present This $299

Deduplication in Distributed Systems: Myths, Realities, and Practical Solutions

Monday, November 25, 2024

This week, we'll discuss the deduplication strategies. We'll see whether they're useful and consider scenarios where you may need them. We'll also do a reality check with the promises

How to know if your data has been exposed

Monday, November 25, 2024

How do you know if your personal data has been leaked? Imagine getting an instant notification if your SSN, credit card, or password has been exposed on the dark web — so you can take action

⚙️ Amazon and Anthropic

Monday, November 25, 2024

Plus: The hidden market of body-centric data ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

⚡ THN Recap: Top Cybersecurity Threats, Tools & Tips (Nov 18-24)

Monday, November 25, 2024

Don't miss the vital updates you need to stay secure. Read the full recap now. The Hacker News THN Recap: Top Cybersecurity Threats, Tools, and Practices (Nov 18 - Nov 24) We hear terms like “state