The return of syslets
Zach's motivation for this work, remember, was to make it easier to implement and maintain proper asynchronous I/O (AIO) support in the kernel. His current work continues toward that goal:
In particular, one
part of the new syslet patch is a replacement for the
io_submit() system call, which is the core of the current AIO
implementation. Rather than start the I/O and return, the new
io_submit() uses the syslet mechanism, eliminating a lot of
special-purpose AIO code in the process. Zach's stated goal is to
get rid of the internal kiocb structure altogether. The current
code is more of a proof of concept, though, with a lot of details yet to
fill in. Some benchmarks have been posted,
though, as Zach says, "They haven't wildly regressed, that's about as much as can be said
with confidence so far.
" It is worth noting that, with this patch,
the kernel is able to do asynchronous buffered I/O through
io_submit(), something which the mainline has never yet supported.
The biggest area of discussion, though, has been over Jeff Garzik's suggestion that the kevent code should be integrated with syslets. Some people like the idea, but others, including Ingo, think that kevents do not provide any sort of demonstrable improvement over the current epoll interface. Ulrich Drepper, the glibc maintainer, disagreed with that assessment, saying that the kevent interface was a step in the right direction if it does not perform any better.
The reasoning behind that point of view is worth a look. The use of the epoll interface requires the creation of a file descriptor. That is fine when applications use epoll directly, but it can be problematic if glibc is trying to poll for events (I/O completions, say) that the application does not see directly. There is a single space for file descriptors, and applications often think they know what should be done with every descriptor in that space. If glibc starts creating its own private file descriptors, it will find itself at the mercy of any application which closes random descriptors, uses dup() without care, etc. So there is no way for glibc to use file descriptors independently from the application.
Possible solutions exist, such as giving glibc a set of private, hidden
descriptors. But Ulrich would rather just go with a memory-based interface
which avoids the problem altogether. And Linus would rather not create any new interfaces at
all. All told, it has the feel of an unfinished discussion; we'll be
seeing it again.
| Index entries for this article | |
|---|---|
| Kernel | Asynchronous I/O |
| Kernel | Events reporting |
| Kernel | Kevent |
| Kernel | Syslets |