4 ms·
io_uring allows the kernel and the user program to communicate purely via shared memory without having to perform a system call, i.e. a context switch to the ke
by ithkuil 6y ago
io_uring allows the kernel and the user program to communicate purely via shared memory without having to perform a system call, i.e. a context switch to the kernel.
Do windows completion ports also work that way or do they involve a system call to be performed in order to consume completion events?
- ta8645 6y agoYou do still need a single system call (io_uring_submit) to submit each batch of entries in the submission queue. Edit: actually no it's not required in all cases. Thanks for the correction.
- WJW 6y agoYou can ask the kernel to poll the submission queue and skip io_uring_submit too. (Though you need elevated privileges to do this IIRC)
- ithkuil 6y agoI only read about io_uring without yet having a chance of actually using it so take this with a grain of salt: I read that io_uring has two modes, one where you signal via a system call and another that uses memory mapped polling. https://unixism.net/loti/tutorial/sq_poll.html https://unixism.net/loti/tutorial/sq_poll.html states: > Reducing the number of system calls is a major aim for io_uring. To this end, io_uring lets you submit I/O requests without you having to make a single system call. This is done via a special submission queue polling feature that io_uring supports.
- yxhuvud 6y agoSubmit is not a syscall. io_uring_enter is the only syscall that is used while running a ring. That one may submit, wait or both at the same time. Strictly speaking it isn't necessary but to avoid it you require elevated privileges.
- frevib 6y agoFrom Linux 5.10 you only need CAP_SYS_NICE to perform SQPOLL: https://git.kernel.dk/cgit/linux-block/commit/?h=io_uring-files_struct&id=03a54c18518d196693217aa9f683369eacb01daf https://git.kernel.dk/cgit/linux-block/commit/?h=io_uring-fi...
- yxhuvud 6y agoYes, hence "elevated" and not "root". It is still higher than default, right?
- junon 6y agoNot with SQPOLL. You can eliminate all syscalls with SQPOLL.
- Matthias247 6y agoWindows registered IO (RIO) does imho the same (https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/hh997032(v=ws.11) https://docs.microsoft.com/en-us/previous-versions/windows/i...). When enqueuing reads/writes with RIO there at least exist flags to specify that the kernel should not immediately be woken up, and thereby to batch syscalls as with io_uring.