Open
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
Contributor
Author
|
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 |
tbodt
reviewed
Nov 15, 2021
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_setupimplio_destroyimplio_submitimplio_submitimplIOCB_CMD_PREADIOCB_CMD_PWRITEIOCB_CMD_FSYNCIOCB_CMD_FDSYNCI don't think this will be possibleIOCB_CMD_POLLIOCB_CMD_NOOPIOCB_CMD_PREADVIOCB_CMD_PWRITEVNon-blocking fallback, leveragingNeither will this.O_NONBLOCKand poll/epoll where availableio_geteventsimplmin_nrandtimeoutsupportI actually can't figure out how this is supposed to workio_cancelimplevt.objto be sign-extended