3 ms·
io_uring does allow to remove a lot of the syscall overhead, without polling. Many operations can be submitted with just one syscall. And ready completions can
by anarazel 6y ago
io_uring does allow to remove a lot of the syscall overhead, without polling. Many operations can be submitted with just one syscall. And ready completions can be consumed without a syscall at all.
Additionally, compared to using epoll/select/.. for network IO, one can just submit a send/recv, instead of patterns like recv -> EAGAIN, epoll, recv
- deleted 6y ago[deleted]
- gpderetta 6y agoIt does remove the syscall overhead, but as the IO itself will be performed by the kernel so the cpu will still need to switch regularly between user and kernel level. With a full user level network stack and correct interrupt steering the kernel need not be involved at all and the cpu can stay in userspace all the time. Or you can run the kernel IO thread on another CPU, but that itself has overhead compared to performing IO and handling the data all in the same thread.
- hawk_ 6y agoI see so the extra kernel IO thread which can be spin waiting is one extra busy core and latency of getting data from one core to the other is the additional overhead.
- jpetso 6y agoAre ready completions strictly determined by continuous polling if there's no system call involved? If lots of applications end up using this method, will it increase power consumption due to many processes actively idling until a new consumable shows up in the completion queue?
- Dylan16807 6y agoThey said without polling. If the queue completely empties, then a normal application will use a system call to go to sleep. But as long as it's not empty, the application can keep receiving events with neither system calls nor active polling. You'd only actively poll in very specialized/niche cases.
- jpetso 6y agoThanks for explaining. I was confused by the "no system call on consumption" example in the blog post, but if it uses a system call after emptying the completion queue then that'll work just fine.