Recently we've started using io_uring for disk access in QuestDB. So far, it's being used in CSV import, but we'd like to expand it to network and other disk access use cases. Apart from the performance boost, the beauty of io_uring is that it allows one to build an event loop on a single I/O multiplexing mechanism. No need to build an ugly combination of epoll and AIO or anything like that - it supports networking, disk access, user events (eventfd), and timers (and not only).
Thank you for highlighting that, part of the design criteria for io_uring was indeed to be able to do everything. It's even mentioned in the second sentence of the linked write-up, no more "everything is a file... until you need to do IO to it".
"Fortunately, future work may make synchronization nonpinning. And, refactoring internals of the java.io package and implementing OS-level APIs such as io_uring on Linux may reduce the number of capturing operations."
for (i = 0; i < BUFS_IN_GROUP; i++) {
/* add each buffer, we'll use i buffer ID */
io_uring_buf_ring_add(br, bufs[i], BUF_SIZE, i,
io_uring_buf_ring_mask(BUFS_IN_GROUP), i);
}
Where did bufs come from? Should that be br.bufs[i]?
The buffers are supplied elsewhere outside that example, just consider it an array of pointers to buffers of size BUF_SIZE. br->bufs[] is the shared space, it holds information on the address/size/id of a given buffer.
could anyone suggest where to learn enough network programming in C/Linux to be able to have the necessary background to start using io_uring?
After working on one of our internal pieces of software, I have a strong hunch that io_uring could boost its throughput, and I'd like to have a PoC, but low-level network programming is definitely outside my areas of expertise.
imho, the best resource for this is unix-network-programming from stevens. i would recommend that you start with his tcp-ip-illustrated-vol-1 first, and then progress from there.
other resources are more of a 'tactical' nature, while what you need is something more strategic.
Find a tutorial that explains how to implement an async runtime on top of epoll using C++20 coroutines. In that context, it is probably easier to use io_uring correctly than epoll.
[+] [-] cormacrelf|3 years ago|reply
[+] [-] laerus|3 years ago|reply
[+] [-] kzrdude|3 years ago|reply
[+] [-] puzpuzpuz-hn|3 years ago|reply
[+] [-] axboe|3 years ago|reply
[+] [-] espoal|3 years ago|reply
[+] [-] bullen|3 years ago|reply
https://blogs.oracle.com/javamagazine/post/java-loom-virtual...
[+] [-] jswrenn|3 years ago|reply
[+] [-] twic|3 years ago|reply
[+] [-] twic|3 years ago|reply
[+] [-] axboe|3 years ago|reply
[+] [-] cgh|3 years ago|reply
[+] [-] espoal|3 years ago|reply
[+] [-] znpy|3 years ago|reply
After working on one of our internal pieces of software, I have a strong hunch that io_uring could boost its throughput, and I'd like to have a PoC, but low-level network programming is definitely outside my areas of expertise.
Any suggestions ?
[+] [-] unmole|3 years ago|reply
[+] [-] weird_user|3 years ago|reply
You might be interested in my book[1] which teaches network programming.
[1] https://build-your-own.org/redis/
[+] [-] signa11|3 years ago|reply
other resources are more of a 'tactical' nature, while what you need is something more strategic.
[+] [-] hedora|3 years ago|reply
[+] [-] neverartful|3 years ago|reply
[+] [-] ilc|3 years ago|reply
DPDK/SPDK are ways to directly to use the device involved.
io_uring is a way to manage event flow between the kernel and userspace.