back to article The next deep magic Linux program to change the world? Io_uring

A few years ago developers knew eBPF as a handy way to build firewalls yet now it's used everywhere for everything. Get ready for io_uring to do the same. Most people don't know the first thing about Linux under the hood. Why should they? Linux, more so than most operating systems, just works. There's no need to poke inside it …

  1. Anonymous Coward
    Anonymous Coward

    Missed opportunity !!! :)

    Where is the (obvious) allusion to :

    “One Ring to rule them all,

    One Ring to find them,

    One Ring to bring them all

    and in the darkness bind them.”

    if you are using 'magic' in your Heading !!!

    :)

    1. vekkq

      Re: Missed opportunity !!! :)

      Darkness = kernel space

      x)

    2. This post has been deleted by its author

  2. old gIT engineer

    Perfect for hackers :)

    It would "make the boundary between user space and kernel space porous."

    - sounds ideal for malware creators?

    1. MiguelC Silver badge

      Re: Perfect for hackers :)

      That was my immediate thought, but then I read that people a lot smarter and knowledgeable in the area than me approve of it, so it must must be OK

      1. quxinot

        Re: Perfect for hackers :)

        Please keep Poettering away from it.

        1. Pirate Dave Silver badge

          Re: Perfect for hackers :)

          Yeah. This io_uring thing sounds like it's BEGGING to store its configuration in a binary blob...

    2. mIVQU#~(p,

      Re: Perfect for hackers :)

      This is why Microsoft ported it.

    3. teknopaul

      Re: Perfect for hackers :)

      No more so than read() and write()

    4. trindflo Bronze badge
      Mushroom

      Re: Perfect for hackers :)

      As @teknopaul alludes, if you are only transferring data across the shared buffer it is not inherently more dangerous than read/write.

      The article describes a circular buffer to speed I/O. It isn't hard to make something like that safe.

      It isn't hard to make it really dangerous if you allow control information across it either. Communicate the index to a jump table and you should have your fingers broken.

      Icon: you are playing with this.

      1. teknopaul

        Re: Perfect for hackers :)

        The article is frankly nonsense, el reg?? . "The next deep magic Linux program to change the world? Io_uring"

        It's not a program. It's a set of 4 or 5 syscalls that guarantees reads and writes are async and userland apis to make the syscalls accessible.

        Modern Linux kernels have these syscalls. They are not very new.

        https://en.m.wikipedia.org/wiki/Io_uring

        Defines it correctly if you are interested in what it really is.

  3. Anonymous Coward
    Anonymous Coward

    gpm is already pretty fast........

    ........identifying and processing 8192 bit primes. Maybe this will allow citizens to use 65536 bit primes to slow down the snoops?

    I think we should be told!...because we need truly unreadable (by snoops) messaging!

  4. Philip Stott

    LMAX Architecture

    Ring buffers a very handy for super fast processing in general.

    Check out Martin Fowler's description of the LMAX Architecture

    1. Anonymous Coward
      Anonymous Coward

      Re: LMAX Architecture

      Super fast if the computations will be quick*, otherwise the cascade puts the system to a crawl, which has and always will be the cautionary gotcha with any asynchronous system, ring based or otherwise. We've all been there as programmers... a bazillion things returning home all at once :-/. Either the system halts or the order of return makes everything worthless (_OR_ you did it correctly the first time like master you are!!!).

      There's a popular saying in parallelism which is Why Wait? Well, typically you don't but if you're going to keep everything in RAM with lo_uring... you're going to need a LOT of RAM so you don't have to wait to ease the stack. I can see committing a bunch of financial or medical transactions quickly but, anything greater than that and resources will grow drastically.

      *quick as in much quicker than the time it takes to round trip this post.

      1. Philip Stott

        Re: LMAX Architecture

        You're right in that operations should be quick, but really the idea is that subtractions from the buffer are asynchronous, so therfore aren't reliant on the buffer thread for synchronising.

        Also, I have only utilised this in. NET for a trading app, so wouldn't like to comment on it's merit for more worthy stuff like health.

        1. Robert Grant

          Re: LMAX Architecture

          I work in health, but I would still say that worthiness is not a performance or correctness characteristic :⁠-⁠)

      2. teknopaul

        Re: LMAX Architecture

        Generally computations are quick.

        Hence the "latencies all developers should know" type articles.

        There is no more ram requirement for async architectures, usually there is less, because each thread has a stack that needs to be swapped in and out. Heap requirements do not change.

  5. Anonymous Coward
    Anonymous Coward

    What an unfortunate name

    Someone must've been taking the piss.

    1. TimMaher Silver badge
      Happy

      Re: What an unfortunate name

      Nope. They just missed out the ‘T’ after the underscore .

      1. Fred Goldstein

        Re: What an unfortunate name

        That's how I first read it in the headline. I thought it was a tribute.

        Of course all of this is done because Unix was originally designed without interprocess communications in mind, so that ended up requiring slow kernel calls, so now various patches are being made to get around that.

  6. Crypto Monad Silver badge

    "there was only a narrow slow bridge of system calls between slow user space and fast kernel space processes"

    To be pedantic, user space is not "slow" and kernel space is not "fast". Both are just as fast as each other, at computation. It's only the bridge that's slow - which data needs to cross, whenever user space wants to ask the kernel to do stuff like network or disk I/O.

    Some projects solve the problem the other way round, e.g. VPP/DPDK where the network drivers and routing stack live entirely in user space.

    1. Lars Silver badge
      Joke

      "To be pedantic".

      I think you succeeded.

      1. Anonymous Coward
        Anonymous Coward

        They succeded

        in being right.

        There are plenty of other shared memory/ring buffer implementations that date back to the y2k era. This may be another way, and have an edge depending on what/where you need to move stuff to. This article makes is sound like they just discovered fire.

        Anybody ripping packets off a TOE card already knows this probably. The HPC crowd is going to toss this into the toolbox along with all of the other funny looking screwdrivers that mostly get used on special occasions.

    2. teknopaul

      With Linux is you can write drivers in kernelspace...

      if you dare ;)

      io_uring is a much safer option.

      And writing kernel code is hard, you don't have handy features like malloc or the ability to save to a file.

  7. Nintendo1889

    BSD

    BSD had BPF since December 19, 1992; 29 years ago.

    1. Anonymous Coward
      Anonymous Coward

      eBPF != BPF

      Pretty much nothing in it related to it's namesake. Totally different architecture, no common syntax, and written by a totally different group.

      1. Anonymous Coward
        Anonymous Coward

        Re: eBPF != BPF

        Which would seem to beg the question: why use the name, then?

        1. Antipode77

          Re: eBPF != BPF

          Same purpose, but quite different under the hood.

          They called it extended BPF.

  8. teknopaul

    Io-uring is not new news

    This has been around for a while now. I had a play with this way back before covid.

    It's a bit of a bugger of an api so it's only worth it if you want really crazy speed.

    I was maxing out my Ethernet hardware with plain old read() write() so it's not clear that there will be lots of practical uses in a PC.

    Network hardware folks might find it more interesting.

    1. Richard 12 Silver badge

      Re: Io-uring is not new news

      True, and true.

      It's only really interesting at the very top end of I/O - file servers, databases, HPC etc.

      That said, because of that it also means that certain things that would otherwise need to be kernel drivers for performance, can be done in userspace instead.

      Which is nice.

    2. Anonymous Coward
      Gimp

      Re: Io-uring is not new news

      I have a pair of switches on the bench at work. They cost about £10,000 each. They have 28 x 10Gb ports and two 100Gb links each. They boot a rather strange Debian for the control plane and the good Lord knows what does the data shifting plane is running - they are running Dell OS10.

      There is a good chance that io_uring and co will blur the old style control/data plane on network hardware and we will get really converged thingies where the switch, router and server (and data) are properly one thing.

      Not yet, despite the bollocks from "hyper converged".

      1. Tom 7

        Re: Io-uring is not new news

        From the word hyperbollocks!

        Isnt the data plane pretty much all hardware with mac addresses triggering the routes through a crosspoint switch? Trying to remember from a 1.6Ghz crosspoint for TV routing from 30 years ago.

  9. OldCrow2

    CDC 6600 had this 50 years ago

    Seymour Cray's CDC 6600 used this idea around 1970, more than 50 years ago. The 10 PPU (Peripheral Processor Units; each 4K words of 18 bits) assignable by the OS for control of devices (disk, tape, etc.) communicated with user programs running asynchronously on the CPU using circular buffers in shared main memory. It was possible to read or write an entire 10.5-inch reel of magtape (~30MB; RAM totaled ~2MB) without stopping the tape except at the end.

    1. diodesign (Written by Reg staff) Silver badge

      Re: CDC 6600 had this 50 years ago

      Yeah, well, we don't have large 1970s Crays on our desks, in our pockets, in our bags, and in our 1U racks in 2023. So we'll make do with this.

      I love the history, don't get me wrong. But that doesn't make today's implementation, for today's computers and users, any less interesting or useful or relevant.

      C.

    2. david 12 Silver badge

      Re: CDC 6600 had this 50 years ago

      A PPU was also what managed the multiple user terminals when the (essentially mainframe / batch system) was used as a 'time share' machine

      1. An_Old_Dog Silver badge

        PPUs and Terminals

        Well, sort-of. There was a high-speed data link between a PPU and a terminal data concentrator (of whatever sort you were using). Our Uni had a PDP-8 with a scad-load of 110- and 300-baud serial lines coming in; it acted as a front-end processor/data concentrator. (It even communicated with the OSes on our two CDC mainframes; typing TRAFFIC at the PDP-8 fetched statistics from the mainframes and printed them for you, so if the systems were heavily-loaded, you could decide to do your on-line work later. But that was a purely locally-implemented feature.)

    3. Tomato42

      Re: CDC 6600 had this 50 years ago

      And IBM has pioneered the process isolation, system isolation, image isolation and application specific accelerators in the mainframe space that we got only recently or are getting just now in the x86_64 space.

      Yes, we should remember the history of the inventions, but an idea without an implementation isn't really useful.

      1. MrBanana

        Re: CDC 6600 had this 50 years ago

        IBM also pioneered employee isolation for the over 50's.

        1. stiine Silver badge

          Re: CDC 6600 had this 50 years ago

          There was prececence from the late 1930's.

    4. An_Old_Dog Silver badge
      Windows

      Re: CDC 6600 had this 50 years ago

      You beat me in posting this!

      The OS (Kronos, then later, NOS) also had an I/O feature called the "auto-recall bit". You used it to select synchronous vs asynchronous I/O for that particular I/O call.

  10. karlkarl Silver badge

    Hasn't io_uring been around for many many years now?

    I remember the day it first appeared, twits flocked to the FreeBSD forums and mailing lists to whine that FreeBSD was old because it didn't have sodding io_uring ;)

  11. knottedhandkerchief

    Conceptually, reminds me of why Node.js is so much faster (and hence rapidly became popular) than say PHP etc in the world of Web apps.

    Makes asynchronous calls to slow processes (network, disk etc) lightweight instead of synchronous and blocking.

  12. MacroRodent
    Headmaster

    Odd subject

    io_uring is an API, not a Linux program.

  13. unix.beard

    I found turning "io_uring" into title case "Io_uring" in this article a bit odd.

    1. VicMortimer Silver badge

      And sans serif fonts that are so idiotically popular these days make it so much worse. Io-uring looks like lo-uring in sans serif.

      And just remembered I could override default fonts. NO MORE SANS! Web pages NOT allowed to override!

      1. stiine Silver badge

        Holy Hell. How many times have i had to paste text into notepad (using a serif font) to be able to tell I's from l's from 1's or 0's from O'.

      2. MiguelC Silver badge

        Re: "NO MORE SANS! Web pages NOT allowed to override!"

        So, in other words, you shot the serif?

  14. Anonymous Coward
    Anonymous Coward

    Wondering about sched policies

    Fundamentally looks the point in the async modus operandi against the sync mode of syscalls. I wonder how interacts and what is the implications on scheduling policies and other areas that do need muted ops. . We have seen these debates on async vs sync in a lot areas from real time systems that forcibly waste cpu cycles to guarantee time share to complete async work done in frameworks like ngix. I guess there will be use case for each.

    1. Tom 7

      Re: Wondering about sched policies

      I'm wondering how SystemD will fuck with this. Because it surely will.

      1. pavel.petrman
        Coat

        Re: Wondering about sched policies

        io_poettering API anyone?

  15. Jan K.

    Phoronix had a bit last week, here https://www.phoronix.com/news/Linux-LPC2022-io_uring_spawn

    Includes John Tripplett's presentation and a pdf slide deck...

    I belong in the group "Most people don't know the first thing about Linux under the hood but nevertheless enjoy following the devs work through the kernel changelogs as well as the public mail lists.

    A privilege I did not had for my past +30 years with Microsoft... two very, very different worlds.

    1. Tom 7

      I'm currently trying to build some documentation that shows how Fuzix works. Basically hyperlinking the code with explanations. Perhaps not the best place to start as there's a lot of cpu dependent code. Its quite an eye opener and I hope it will be a useful educational tool. I may move onto Linux when done.

  16. Fruit and Nutcase Silver badge
    Joke

    The many rings of Linux

    Io_uring, Po_ettering

  17. Anonymous Coward
    Anonymous Coward

    Linux needs this, like if I have 128 pcie4 lanes filled with nvme io could be hitting 200 GB/sec and tens of millions of io's/sec so FIX THE KERNEL to make that efficient o.o

    Now we need file systems to use it, like if xfs rewrote everything in io_uring that would be awesome o.o

  18. Anonymous Coward
    Anonymous Coward

    It strikes me that the approach should be generalized for any device that can handle asynchronous IO, not just file systems... and I'm hoping they've either already done that or have plans to do so in the future.

    Despite the Linux mantra, I can tell you with emphasis that the world is not comprised entirely of files and devices.

  19. IGnatius T Foobar !

    Windows is obsolete.

    As revealed this week, Microsoft chose to port eBPF into Windows rather than try to duplicate its functionality with its own program. io_uring may become the next Swiss-Army tool for Linux developers.

    Windows is obsolete. It carries on as a majority desktop operating system, for the time being, only because of the momentum of its massive installed base. Everywhere else, it is in decline and everyone everywhere agrees that it is a developmental dead end. The cloud runs on Linux. Mobile runs on Linux (Apple variants notwithstanding). Containers run on Linux. Software-defined storage/networking/etc. runs on Linux.

    In the data center and in the cloud, no one chooses Windows Server anymore, except to run legacy software. Windows Mobile is dead. Windows Embedded is dead.

    Microsoft would do well to continue porting Linux technologies to Windows, but at the same time working to phase out Windows entirely.

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