289 points · by sohkamyung · 3y ago · 70 comments
Our general take was also that it has a lot of potential, but is relatively low level that most mainstream programmers aren't going to pay attention to it. Hence, it'll be a while before it permeates through various ecosystems.
For those of you that like to listen on the way to work, we cover io_uring on our podcast, The Technium.
https://www.youtube.com/watch?v=Ebpnd7rPpdI
https://open.spotify.com/episode/3MG2FmpE3NP7AK7zqQFArE?si=s...
On a related note, I recently saw this presentation[1] where they show some benchmarks of the various modes.
One gotcha of sorts, though obvious when you think about it, is that the kernel-side polling mode requires a free CPU core for the polling thread. Meaning you'll get very poor performance if you're not leaving enough CPU for the kernel to do its polling.
Isn't that what libraries are for?
this may take a while as it's a completely different IO model
it took us 30 odd years to get from select/epoll to async/coroutines being popular
3 decades.
(which no-one uses either because the API doesn't compose well onto existing application structures)
There's also a syscall (io_uring_enter) that will do a context switch and wake you up when completions are available (it's a complicated syscall, that has a lot of knobs and switches and levers - just be ready for a LOT of information if you go read the man page).
https://github.com/uNetworking/uWebSockets/issues/1603#issue...
A big todo I have for this is to modify it to accept multishot_accept but I haven't been able to get a recent enough kernel configured properly to do it. (Only >6.0 kernels support multishot accept).
(edit) you need to s/multishot_accept/recv_multishot/g above :)
Thank you so much Martin Jacob!
The things you work on are foundations to extremely useful systems.
(My JIT compiler is based on Martin Jacob's JIT code https://github.com/samsquire/compiler )
I would love to change my epoll server to use liburing and if I feel confident enough to I'll try integrate your code into it.
At least, that's my untested understanding.
“this is the wiki of nick black (aka dank), located at 33°46′44.4"N, 84°23'2.4"W (33.779, 85.384) in the heart of midtown atlanta. dankwiki's rollin' wit' you, though I make no guarantees of its correctness, relevance, nor timeliness. track changes using the recent changes page. I've revived DANKBLOG, this wiki and grad school having not satisfied ye olde furor scribendi.
hack the planet! don't mistake my kindness for weakness.
i primarily write to force my own understanding, and remember things (a few entries are actually semi-authoritative). i'm just a disreputable Mariner on your way to the Wedding. if you derive use from this wiki, consider yourself lucky, and please get confirmation before relying on my writeups to perform surgery, design planes, determine whether a graph G is an Aanderaa–Rosenberg scorpion, or feed your pet rhinoceros. do not proceed if allergic to linux, postmodern literature, nuclear physics, or cartoonish supervillainy. “
I’ve had his grad-school project libtorque[2] (HotPar ’10), an event-handling and scheduling library, on my to-read list for years, but I can’t seem to figure out how it accomplishes the interesting things it does.
[1] https://nick-black.com/dankwiki/index.php/Notcurses, https://github.com/dankamongmen/notcurses/
1. enroll.
2. get tired of dorm life.
3. move to home park because it's likely all you can afford.
4. get broken into 5-10 times.
5. move away
Not one break in!
Figured no one thought we were worth it. Although we were two houses across the street from Kool Korner, so maybe that was the "nicer" part of Home Park?
I'd be curious to see
1. A Hello World, absolute minimum example
and
2. Doing something it's designed to do well, cut down to as small an example as possible.
Sheez, downvoters, I'm curious about it, and want to see an example. You don't learn to drive a car by reading the engine specs, either.
Right now, what it can do really well is non-blocking file IO. My (limited) understanding is that as of now, the benefits of io_uring over epoll for network IO is a bit more ambiguous. That said, io_uring is adding new features (already available in linux 6 kernel) that are really promising. See https://github.com/axboe/liburing/wiki/io_uring-and-networki....
https://www.scylladb.com/2020/05/05/how-io_uring-and-ebpf-wi...
Look at AMD gpu command buffers, and xHCI (and NVMe).
But among those "ring buffers", which one is the best? (from a consumer/producer concurrent access, on a modern CPU ofc).
If the commands are not convoluted, the programming is soooo much simpler and cleaner.
It seems USB xHCI is the "most concurrent friendly" and hardwarely friendly (IOMMU and non-IOMMU) as it supports "sparse ring buffers" (non continous in bus address space). AMD gpu ring buffers are atomic read/write pointers (command ring buffers and "interrupt"/completion ring buffers) with doorbells to notify pointer updates.
I should have a look at linux IO uring to see how far they did go and which model they did choose.
I wonder how modern hardware could use anything else than command ring buffers.
Including a tl;dr, pros, cons, tools & players, and a forecast.
The creator of io_uring Jens was super nice and also reviewed it (I'm still a bit in shock).
Pretty cool to see how far IO APIs have come with this.
Glommio is a thread-per-core async executor/framework that supports io_uring however.