←back to thread

lsr: ls with io_uring

(rockorager.dev)
335 points mpweiher | 4 comments | | HN request time: 0.914s | source
1. Bender ◴[] No.44604402[source]
I am curious what would happen if ls and other commands were replaced using io_uring and kernel.io_uring_disabled was set to 1. Would it fall back to an older behavior or would the ability to disable it be removed?
replies(2): >>44606541 #>>44606600 #
2. rockorager ◴[] No.44606541[source]
You would have to write your IO to have a fallback. The Ghostty project uses `io_uring`, but on kernels where it isn't available it falls back to an `epoll` model. That's all handled at the library level by libxev.
3. yencabulator ◴[] No.44606600[source]
I just realized that one could probably write a userspace io_uring emulator in a library that spawns a thread to read the ringbuffer and a worker pool of threads to do the blocking operations. You'd need to get the main software to make calls to your library instead of the io_uring syscalls, that's it; the app logic could remain the same.

Then all the software wanting to use io_uring wouldn't need to write their low-level things twice.

replies(1): >>44609097 #
4. Asmod4n ◴[] No.44609097[source]
I'm about to start something like this targetting epoll, poll, dispatch_io and maybe kqueue this weekend.