back to article Removing an obsolete AMD fix makes Linux kernel 6 quicker

An ancient fix for power management issues on AMD systems has been reducing Linux's performance since 2002. Now it's gone. One of the joys of modern silicon chips is that power management is vitally important. It hasn't been about saving power or extending battery life since the 20th century. Processor vendors survive by …

  1. Snake Silver badge
    Angel

    Why mince words??

    "ACPI is a complete design disaster in every way. But we're kind of stuck with it. If any Intel people are listening to this and you had anything to do with ACPI, shoot yourself now, before you reproduce."

    Now that's getting down to the point :p

    But in all seriousness, something like this should have been reviewed long ago.

    1. Flocke Kroes Silver badge

      Re: Why mince words??

      A key part of it is no-one noticed any problems. It only shows in the C2 power state, which is very unlikely on servers. It is common on laptops but AMD laptops are rare.

      1. Anonymous Coward
        Anonymous Coward

        Re: Why mince words??

        I keep seeing this being said here, but last quarter AMD had 26.8% of the laptop sales market. Sure, that's not a majority, but it's not exactly "Bigfoot" rare.

      2. Jakester

        Re: Why mince words??

        Every time I look at the lineup of laptops in the store, I see a mix of Intel and AMD units. How can you say they are rare?

        1. MyffyW Silver badge

          Re: Why mince words??

          In fairness to the original reply, the number running Linux on an AMD laptop is a small subset of about 1/4 of the market. Not Bigfoot, but rather like that fox I saw wandering across the car park this morning.

          1. danbi

            Re: Why mince words??

            My casual observation, which is far from representative is that higher percentage of AMD laptops are sold with Linux.

          2. Loyal Commenter Silver badge

            Re: Why mince words??

            Not Bigfoot, but rather like that fox I saw wandering across the car park this morning.

            I think you may have inadvertently hit the nail on the head there.

            We are at pretty much the exact time of year when this year's litters of fox cubs are grown up and start fighting each other for territory. This means that there are *lots* of them wandering about, and if you asked a random sample of people who had been in a car park this morning, a good number of them are likely to have seen a fox there...

            As noted by another commenter here, those who buy AMD are also more likely to be those who run Linux.

            The technical term for this is "selection bias".

            1. MyffyW Silver badge

              Re: Why mince words??

              Well that - and the unusually large pile of kebab debris in the car park - explains matters :-)

    2. gerryg

      We're all wise in retrospect

      "But in all seriousness, something like this should have been reviewed long ago."

      It seems like it was a small piece of code tucked away minding its own business. If I understand correctly you'd mostly notice it if you had an AMD laptop and there are few of those.

      So given this is of of those issues for "need for speed" types the client group is not them and probably tiny. So no-one noticed.

      But finally someone did and I envisage that still no-one will notice.

      1. david bates

        Re: We're all wise in retrospect

        Are there few of those? My Thinkpad certainly has a Ryzen sticker on it, and it was hardly difficult to find AMD machines from major manufacturers.

      2. Al fazed
        Happy

        Re: We're all wise in retrospect

        I hope that I will notice a difference as the last two unwanted PC's that I brought home have AMD chips.

        They are now running MX-Linux sweetly on only 4GB memory and are looking for a home.

        ALF

        1. anonymous boring coward Silver badge

          Re: We're all wise in retrospect

          “only 4GB memory”

          I recall when 4MB was a lot of memory. 1024 times less.

          1. jake Silver badge

            Re: We're all wise in retrospect

            Many who post here remember when 4K was normal for home use.

      3. BOFH in Training

        Re: We're all wise in retrospect

        Well, my Laptop, a Lenovo Legion 7 with an AMD Ryzen 9 5900HX states that it has a "need for speed".

        Will not be buying this sort of laptops if I was just going to browse the net and watch some videos with it.

        Trust me, there are alot of technical power users who have gotten high end AMD laptops.

        1. sreynolds

          Re: We're all wise in retrospect

          Yeah but in all fairness the alternative device trees isn't that much better. I mean granted you can't call and execute code using device trees but they are still not that much better.

  2. Timto

    There's an obsolute compatibility patch running on my PC

    It's called Windows

    1. Flocke Kroes Silver badge

      Re: There's an obsolute compatibility patch running on my PC

      Has this performance reducer been fixed in Windows? Did anyone notice?

      1. Jim Mitchell

        Re: There's an obsolute compatibility patch running on my PC

        Does Windows have this issue?

        1. Flocke Kroes Silver badge

          Re: There's an obsolute compatibility patch running on my PC

          As far as I know Windows worked on ancient AMD laptops with VIA chip sets so they must have had some solution to the original problem. I have no idea if their fix had the same issues or if it remains as cruft to this day. By all means, check the source code and find out. If like me you do not have access to the source code you could try installing a modern version of Windows on 20 year old hardware. If turning off power management makes it work that would suggest that the fix has been removed.

        2. Sandtitz Silver badge

          Re: There's an obsolute compatibility patch running on my PC

          "Does Windows have this issue?"

          Probably not but does it matter?

          Whenever there's a bug found in Linux (or any FOSS) someone is soon bound to post the mandatory "Windows sucks" and the acolytes are automatically upvoting it.

        3. simonlb Silver badge
          Trollface

          Re: There's an obsolute compatibility patch running on my PC

          Windows has got many more, much bigger issues than this to worry about.

  3. Bitsminer Silver badge

    It's official

    The issue it fixes is long gone....

    Nobody understands it, it does things nobody wants, and it took an accident to find the bug.

    Linux is now officially legacy software.

    1. teknopaul

      Re: It's official

      It's a good point no-one has really solved the "legacy software" issue.

      What the world needs is a future bug reporting system (tm) , so you can report this will be an issue when x happens.

      Todos are the devil's work, we need something outside the code base.

    2. Kristian Walsh Silver badge

      Re: It's official

      It has been for a long time.

      This fix might encourage someone else to look through other active waits in the kernel, but to be honest, this is pretty specialised work, even for kernel development, and anyone who can do a patch that fixes more than it risks breaking is too busy working on upcoming CPUs.

      I thought it was ironic that an engineer employed by Intel has submitted a kernel patch that improves the performance of AMD chips. A nice example against fanboyism there...

      1. uro

        Re: It's official

        > I thought it was ironic that an engineer employed by Intel has submitted a kernel patch that improves the performance of AMD chips. A nice example against fanboyism there...

        The initial patch was submitted by AMD after they discovered the issue, the Intel engineer, Dave Hansen, cleaned it up and simplified it, so credit is due to both AMD and Intel for implementing the fix.

        Source: https://www.phoronix.com/news/Linux-6.0-AMD-Chipset-WA

  4. DenTheMan

    The older the OS...

    ...the faster it is.

    Every new OS adds millions of lines of code, much of the time the new code being bolted on to add to overhead.

    I would love to see Windows 3.11 made to work, despite the interface being upteen times slower than Dos.

    1. Flocke Kroes Silver badge

      Re: The older the OS...

      Here you go: Windows 3.11 under QEMU.

    2. Liam Proven (Written by Reg staff) Silver badge

      Re: The older the OS...

      > I would love to see Windows 3.11 made to work

      Good gracious, really? No thanks!

      I can think of a dozen OSes from Þe Olde Times I'd rather see put out there for an update.

      Windows 2000 on a modern computer would be quite nice. I long hoped that the ReactOS folks would get there some day, but if they did, I think a Microsoft sue-ball would leave nothing but a smoking crater.

      Win2K is of course just Windows NT version 5, and since MS is still selling Windows NT, it's not going to make any version of NT FOSS. But by this point, it could certainly release all versions of DOS right up to MS-DOS 6.22 and all versions of 16/32-bit Windows, from 1.0 to Windows ME, without giving away any commercially-significant IP.

      And if MS were to let all 20th century versions of Windows be made open source, then it could do a deal with IBM and release OS/2 as well.

      OS/2 was great in about 1992. If IBM was unwilling to release the IBM-only x86 OS/2, which is after all still on sale, perhaps it could release Workplace OS/2, the IBM-only PowerPC edition.

      That ran on Mach. Mach is still maintained, and Apple still releases the Darwin source code.

      https://github.com/apple/darwin-xnu

      Or how about BeOS, still clutched tightly by Access Ltd of Japan, not even slightly well-known for writing the web browser in the Amazon Kindle.

      Access also owns PalmOS, including PalmOS Cobalt, released but never shipped on any hardware.

      https://www.palmsource.com/palmos/cobalt.html

      1. This post has been deleted by its author

        1. Paul Crawford Silver badge

          Re: The older the OS...

          But the interface and layout is good. Maybe the best MS ever did.

          I still have a w2k VM for some old CAD software, runs just fine on my Linux host (which has SSD in RAID beneath ext4 file systems) but limited memory by modern standards (borks if given over 2GB RAM!) even though it really does not need it.

          Yes, no USB support (less "autorun infestations") but in VMware you can just drag and drop files in from the host (or host mounted USB drive).

        2. rcxb Silver badge

          Re: The older the OS...

          No SSD support. No USB support. No 64-bit support. Barely multicore support.

          NO idea what "SSD support" you think is needed... W2K can certainly be installed on SATA SSDs.

          W2K certainly has USB support. What wasn't included was a USB-Mass storage driver by default, however there are simple 3rd party drivers that add it. In fact, there are USB drivers for NT4.0!

          No 64-bit support just means no single application can use more than 4GB of RAM. I guess you won't be running Chrome, but otherwise you're fine.

          W2K works on multi-core systems.

          There is a whole community of people who are keeping W2K and XP in active use, today. With the MyPal browser you can still visit modern websites and KernelEx allows running lots of software that shouldn't work...

          1. This post has been deleted by its author

            1. Michael Wojcik Silver badge

              Re: The older the OS...

              Even WinNT 4 supported two CPUs. I had a dual-processor NT 4 machine I used for stress-testing some software, in the hope of having better odds of winkling out race conditions and the like.

        3. RAMChYLD

          Re: The older the OS...

          Windows 2000 does have USB support. The only catch is that it's quite primitive and each USB device requires it's own set of drivers (understandable since Universal Audio Class and Universal Video Class didn't exist yet and USB HID and USB Mass Storage was relatively new- I could get a USB Logitech optical mouse to work but not a USB gamepad adapter).

          It also does support SATA SSDs, but no TRIM unless you install programs the SSD ship with, and you need to run TRIM manually every month or so. NVMe SSDs are out tho.

          You're correct about 64-bit support tho.

        4. Liam Proven (Written by Reg staff) Silver badge

          Re: The older the OS...

          I think that Sir does not remember his Windows versions very well.

          You are thinking of NT 4. That did not support power management, USB, or FAT32.

          Windows 2000 did all of those, out of the box at launch. It supported 2 CPU cores and I think the server version supported 4.

          If I remember rightly, Win2K got USB *2* support with SP4.

          An SSD is just a disk drive. You can certainly install Win2K on an SSD and I think I did it, long ago for experimental purposes. No, it does not support `trim` but that is not life and death. One could boot Linux occasionally to trim the SSD if necessary.

          No, it did not have a 64-bit version. But to be honest, on an old laptop with 4GB of RAM, I think the x86-32 version with PAE turned on would do me fine. :-)

          (Windows supports PAE just fine, allowing more than 4GB of RAM on 32-bit versions, but MS only *enables* it on the Server editions. It is possible to hack Windows Workstation to load the Server kernel and thus get support for more RAM.)

        5. jake Silver badge

          Re: The older the OS...

          "No it wouldn't."

          Yes, it is! I still use Win2K near daily. It runs ACad2K quite nicely, thank you very much. Why yes, she is airgapped, why do you ask?

          IMO, Win2K was peak Microsoft. It's all been downhill from there.

          I also think ACad2K was peak Autodesk ... for my needs, anyway.

      2. ironstar

        Re: The older the OS...

        Speaking of long-dead OS we'd like to see back,how about UIQ 3? A Symbian that wasn't painfully early '00s to use, held back by lack of adoption, and Sony doing a Sony

        1. Liam Proven (Written by Reg staff) Silver badge

          Re: The older the OS...

          Symbian already *is* FOSS. The source code is here:

          https://github.com/SymbianSource

          Go and get a few people together and you can start reviving it right now.

          1. ironstar

            Re: The older the OS...

            Not UIQ though? Haven't seen it in the repo, not that I've looked very hard though.

          2. Dan 55 Silver badge

            Re: The older the OS...

            Did the Belle UI get uploaded or did Nokia keep that? I suspect it was the latter.

      3. DJV Silver badge

        Re: The older the OS...

        Upvoted for the use of the "Þ" and knowing NOT to put a "Y" there instead.

        1. Frumious Bandersnatch

          Re: The older the OS...

          Upvoted for the use of the "Þ" and knowing NOT to put a "Y" there instead.

          Yes, shout-out for thorne!

        2. This post has been deleted by its author

          1. The Indomitable Gall

            Re: The older the OS...

            Pretty sure it's attested in Middle English literature.

            I saw the claim once that scribes were paid by the letter at some point in the Middle Ages, and therefore started adding in silent Es and unnecessary double letters. I wasn't convinced, but it's not beyond the realms of possibility...

            1. jake Silver badge

              Re: The older the OS...

              "Pretty sure it's attested in Middle English literature."

              "Olde" was from ~1883. An invention of Victorian romantics.

              Old English used "ald", as did Old Frisian. Kentish and West Saxon had the "eald" variant, the Scots "auld". Late Old English started using "old" in similar places that we do today. By the time Middle English had settled down, "old" meant pretty much exactly what it does today.

              1. Julian Bradfield

                Re: The older the OS...

                Forms of "old" with final -e are given in the OED from about 1200 to 1530.

                1. jake Silver badge

                  Re: The older the OS...

                  "Forms of "old" with final -e are given in the OED from about 1200 to 1530."

                  Yeah, but ... "English" wasn't really standardized until relatively recently ... some say as late as the 18th century, some say it still hasn't been. People often wrote phonetically, according to their local accent. The widespread use of the printing press helped everybody get on the same page (as it were), improving basic literacy world-wide over the decades. (Only to have Web Forums come along and completely fuck that trend up ... but that's a rant for another day.)

                  But I digress ... The (few) examples of "olde" prior to the mid-1880s were not Ecclesiastical, nor collegiate in nature. Most likely they were missplelings by under-educated scribes, but they could have been regional (perhaps phonetic) differences. Unfortunately, there aren't enough examples out there to say whether or not it was "normal, and thus a part of English as she was writ, or not.

                  Most linguists say the jury is still out, but lean heavily towards "no, "olde" was just a misspelling on a few surviving documents from that era".

        3. Liam Proven (Written by Reg staff) Silver badge

          Re: The older the OS...

          I thank thee, good sir.

          1. James Hughes 1

            Re: The older the OS...

            Sire.

          2. Anonymous Coward Silver badge
            Trollface

            Re: The older the OS...

            I Þank Þee

            1. jake Silver badge

              Re: The older the OS...

              In Old English, that would be "þancian Þe" (think Old High German "danchon").

              "Thee" is from the mid-1600s, popularized by the Quakers.

      4. Charlie van Becelaere

        Re: The older the OS...

        "Or how about BeOS, still clutched tightly by Access Ltd of Japan"

        Could there be a better company name than Access Limited in this case?

        Nicely done, Access!

      5. simonlb Silver badge
        FAIL

        Re: The older the OS...

        OS/2. Yeah.

        Back in 1994 I went to a computer show in Birmingham (UK) with a friend and we saw a demo of OS/2 warp. My friend was so impressed he bought a copy as it looked to be leagues ahead of Windows at that time. However, despite multiple attempts neither of us could get it to install on our respective PC's (486 DX2/66, 8Mb Ram, 1Mb VLBus video card and AMD 486 DX-40, 4Mb Ram, 1 Mb SVGA card.) At the time I was working for HP and had access to a DR suite with a room full of PC's of different specs, but was unable to get it to install on 3 different models of HP PC. In the end we gave up as despite a number of phone calls to IBM my friend got no help whatsoever. But every single one of these PC's ran DOS and Windows 3.1/3.11 for Workgroups fine, and fast forward a year when Windows 95 arrived and that just worked out of the box on all these machines straight away.

        Eventually my friend used the install CD as a coaster on his desk and joked it was much more use.

        1. Anonymous Coward
          Anonymous Coward

          Re: The older the OS...

          I got os/2 warp for my 12th birthday back in the 90s. Got it to run on several 486's of similar specs first time without any issues so dunno what you were doing wrong.

          It was my go to OS for a few years but eventually the draw of 32bit windows was too much and I had to, reluctantly, use windows 98.

          1. Michael Wojcik Silver badge

            Re: The older the OS...

            I too had Warp (and then Warp Connect) running on a number of different work machines. We'd been using OS/2 since 1.1.

            I eventually had to get Windows 98 on my work laptop (a Thinkpad of some vintage) in order to run various company-mandated nonsense that wouldn't quite work under the OS/2 version of Win32s. I kept my OS/2 drive1 for some years after that, but found myself using it less and less and fnally it went on the shelf.

            I found shrinkwrapped boxes of Warp Connect and IBM VisualAge C++ for OS/2 when I was cleaning out the basement a couple of years ago, and gave them to a friend who expressed interest.

            1Drive swapping was easy on the older Thinkpads: Power the machine down, unlatch the keyboard, lift it, pull out the drive, pop the new one in. No tools needed. For a while I had drives with Windows, OS/2, and Linux in my computer bag, and I'd just switch between them as required.

        2. Liam Proven (Written by Reg staff) Silver badge

          Re: The older the OS...

          I bought OS/2 2.0 for cash, which I have never done with a PC OS before or since, and ran it on both 486s and indeed later on a 386SX or two. (No, not all at the same time.)

          I was very fond of it, and at the time, circa 1992, it was by far the best x86 OS there was. Linux was on kernel 0.something and barely ran X11, Windows was on v3.1 and was awful.

          Yes, sure, driver support was poor, but it was 100% doable. But you needed a clue what you were doing. Many PC users didn't have that, and OS/2 was probably the product that demonstrated this to them. ;-)

          I think one of the the biggest mis-steps IBM made in the Warp era was putting a time-bombed demo copy on a magazine cover CD.

          A demo OS, which needs to take over your hard disk but which, even if you get it working, will expire? That is not a great plan, to put it mildly.

      6. Loyal Commenter Silver badge

        Re: The older the OS...

        I'm upvoting you just for the use of the letter thorn.

        edit - I see I'm not the only one

      7. ecarlseen

        Re: The older the OS...

        OK, I'm going deep nerdcore on you:

        GeoWorks Ensemble, a little-remembered Windows 3 competitor with core functionality written in hand-optimized assembly language. It ran reasonably-well on 8086 machines in 640K and smoking fast on an 80286 with 2MB. Great multi-tasking, and I never saw a crash on it that couldn't be traced to a bad memory chip.

        They never released and SDK, therefore nobody could write apps for it, and it died in obscurity. But it was seriously sweet for what it was.

        1. jake Silver badge

          Re: The older the OS...

          The 16-bit PC/GEOS[0] operating system (later just GEOS, then Geoworks Ensemble) ain't nerdcore. Early AOL floppies came with a runtime version of PC/GEOS that could be modified to become HDD bootable. I know a couple of folks who used this as a primary GUI to get computer illiterate folks online.

          You want nerdcore? Try DesqView. Ran Win3.x in a window.

          [0] Note that the 8-bit software also called GEOS, and from the same company, for the C-64 and Apple ][, is a completely separate code base and mostly incompatible with the later 16-bit code.

    3. trindflo Bronze badge
      Boffin

      Re: The older the OS...

      DOS isn't really an OS so much as a program loader and some device primitives, many of which are wrappers for BIOS calls.

      As such DOS can be faster at doing a single thing.

      If you want to service interrupts at the same time, and you have a CPU with multiple cores, you benefit from an OS that can manage multiple cores and can service an interrupt in one core while the other cores are doing something else. DOS can't handle multiple cores (although I think there are some DOS extenders that can).

      So I agree with you for very simple use cases. For most real uses, I think DOS gets left in the dust pretty quickly.

      1. The Indomitable Gall

        Re: The older the OS...

        That was what an OS was.

        1. TimMaher Silver badge
          Windows

          Re: OS was...

          ... and, if you go back to the days of the IBM 360 series you had BOS, TOS and DOS. In that sequence of complexity.

        2. jake Silver badge

          Re: The older the OS...

          "That was what an OS was."

          No, it was not.

      2. DenTheMan

        Re: The older the OS...

        All software was standalone. Windows and its ever and ever bigger APIs meant fast coding at the expense of native speed.

        Yet the principal us the exact same. Dos is an OS.

        1. jake Silver badge

          Re: The older the OS...

          "Dos is an OS."

          No, it is not.

          A program loader (ex. MS-DOS) is not an operating system (ex. TOPS-20). In a program loader, the user can fully control all of the hardware without requiring permissions to be set. An OS has complete control of the hardware (pace root/administrative access capabilities, of course).

          Both have their place in computing.

    4. teknopaul

      Re: The older the OS...

      You never know, some of that code could have been written to make it run faster!

  5. Lars Silver badge
    Pint

    shoot yourself now, before you reproduce

    That made me smile.

    Damn it, is Linus getting old and "kind".

    1. wolfetone Silver badge

      Re: shoot yourself now, before you reproduce

      I'd like to think he's become more cynical, and has realised the futility in kicking against these idiots, as while you dispatch one idiot you only end up having two replace them.

      For a modern example, please see the current Conservative party.

      1. oiseau
        Facepalm

        Re: shoot yourself now, before you reproduce

        ... see the current Conservative party.

        Current, you say?

        Current?

        Much to my chagrin, practically every Conservative party (local and foreign) sympathiser/enthusiast/member/voter I have known is/was a dick-head.

        Including my dear uncle Albert.

        Of course, there have been exceptions.

        But those have been a minority.

        O.

      2. Anonymous Coward
        Anonymous Coward

        Re: shoot yourself now, before you reproduce

        Can we keep the fucking politics out please. For ANY party? There is a time and place, and this site is NOT one of them.

        1. Ken Hagan Gold badge

          Re: shoot yourself now, before you reproduce

          I don't know about "this site", since it has pretty wide-ranging articles, but "this article" seems like it would be better without politics, so yeah.

          1. oiseau
            Childcatcher

            Re: shoot yourself now, before you reproduce

            ... like it would be better without politics ...

            Yes, you are right. I got carried away.

            I'll leave my uncle Albert out of it.

            O.

          2. nintendoeats

            Re: shoot yourself now, before you reproduce

            "Ted Bundy was a psychopath."

            "Do you know who ELSE is a psychopath? All <members of a group>."

            Not exactly a sequitur.

  6. CustomCruiser

    Welp

    Better late than never, I guess.

  7. Chewi

    There may have been clues a few years back

    Some of you may recall the early Ryzen CPUs had an issue where they would just randomly freeze up after hours or days under Linux. It only seemed to happen when the system was very idle. I said half-jokingly that this wasn't seen on Windows because it never gets that idle. I then heard through the grapevine that people inside AMD thought that may indeed be the case.

    I'm no expert, but I now reckon this kernel bug was causing it to happen more often than it otherwise would have. Maybe it's just as well. If it hadn't happened so frequently, AMD may have taken much longer to fix it.

    1. NATTtrash

      Re: There may have been clues a few years back

      Some of you may recall the early Ryzen CPUs had an issue where they would just randomly freeze up after hours or days under Linux.

      I remember this too. Deactivating C(6) state was the solution, right? I can remember especially the Fedora people being on it, an early python script deactivating it, and later BIOS settings for it popping up on AM4 mobos.

  8. Sven Coenye
    Stop

    That's weird...

    From the patch linked to in the article:

    + /*

    + * Modern (>=Nehalem) Intel systems use ACPI via intel_idle,

    + * not this code. Assume that any Intel systems using this

    + * are ancient and may need the dummy wait. This also assumes

    + * that the motivating chipset issue was Intel-only.

    + */

    So Intel claims the problem was theirs, even though it was only detected on AMD + Via ?? And it makes no sense for that to be a typo, as there would be no need to leave it in place for Intel CPUs if the issue was AMD-only.

    1. nintendoeats

      Re: That's weird...

      I was wondering the same thing...je ne comprends pas.

      1. teknopaul

        Re: That's weird...

        Perhaps Mr AMD doesn't have a way to regression test a bunch of old Intel cpus?

  9. ghp

    Let me get this straight: doing nothing on an AMD will now be faster?

    I applied the patch to 5.19.11 kernel and built it before and after (using 8 of the 16 available "processors"). Time reported a very small improvement which I didn't notice.

    Perhaps this was meant to be an october's foolsday joke?

    Please react the way young Linus would have done and show me the error of my ways.

    PS. I've got nothing but AMD in the house, be it lap-, desk- or over the top.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like