-
-
Notifications
You must be signed in to change notification settings - Fork 911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async I/O (syscalls 245 - 249) #1584
base: master
Are you sure you want to change the base?
Conversation
e401e67
to
97b7657
Compare
…an access allocated memory in the guest. This also slightly changes the AIO context ownership model: while it is still refcounted and retained by any pending requests, any context that does not have a valid task cannot resolve those requests. We flag such orphaned contexts, but allow the context to live until all pending requests have gotten the message and released the context.
I'm assuming `EAGAIN` is the correct error code for running out of events in a context.
This necessitates externally-controlled lock lifetimes, since we need to return pointers into context-owned shared data. This comes with the usual warnings about memory safety.
We don't have a way to actually tell an FD to run an async I/O operation yet, so that's still TODO'd.
…the event came from.
…ngs they shouldn't
f612141
to
60e6c82
Compare
I've managed to get this to build again. I'm going to release the draft flag on this PR. It should be sufficient enough to run software that needs async I/O, albeit not with the speed benefits. A good idea for a future PR would be hooking this system up to POSIX AIO (or whatever else iOS supports) to do proper parallel IO on the host filesystem. I wasn't able to write tests for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat! Did a quick review now, soon I hope to find the time to learn a bit about how AIO works so I can do a real review.
PS: please fix the tests :)
cd06108
to
15f09b2
Compare
… signalled if min_nr hasn't been reached
…tructure and static asserts
89bf3b1
to
db0c0aa
Compare
…tructure and static asserts.
eafda59
to
709b16e
Compare
13f779d
to
6c09ad5
Compare
Linux has an async I/O facility (separate from epoll) that allows sending a small handful of file operations (notably, positioned and/or vectored reads and writes, syncs, and possibly also poll) on an already-open FD into an in-kernel context, and then retrieving all of their results at a later time. It's almost like an early prototype of modern Linux's
io_uring
, but using syscalls instead of ring buffers.io_setup
implio_destroy
implio_submit
implio_submit
implIOCB_CMD_PREAD
IOCB_CMD_PWRITE
IOCB_CMD_FSYNC
IOCB_CMD_FDSYNC
I don't think this will be possibleIOCB_CMD_POLL
IOCB_CMD_NOOP
IOCB_CMD_PREADV
IOCB_CMD_PWRITEV
Non-blocking fallback, leveragingNeither will this.O_NONBLOCK
and poll/epoll where availableio_getevents
implmin_nr
andtimeout
supportI actually can't figure out how this is supposed to workio_cancel
implevt.obj
to be sign-extended