runtime: I/O API + simulator - #5658
Conversation
cb79364 to
031d709
Compare
Shubham8287
left a comment
There was a problem hiding this comment.
This seems really good, I just think we should have sim I/O ops to use time to simulate latencies, Which is also required for sim executor to make progress correctly.
We can merge this PR, and do it in next PR though (Before we start using uring interface)
Entails making it Send + Sync, which may or may not be what we want.
|
Putting this back into draft as I had to rework it substantially. Namely, in order to support concurrency (like To do that, then, the I don't think it's a big issue, because the API itself must come from somewhere, and we only really need the runtime to drive the completion futures (i.e. I'm keeping the PR in draft for now, as I think the |
Do you consider |
I don't think there is any other solution if we want it to work with actual io-uring. I'm imagining that the pre-allocated memory is allocated on the heap (e.g. |
Yeah, I was expecting something in that direction and, I also think Though, None of it needs to be addressed in this PR. |
| fn maybe_write_fault(&self, rng: &Rng, now: Instant, page_offset: usize) -> Option<WriteFault>; | ||
| } | ||
|
|
||
| pub struct Executor<const MAX_INFLIGHT: usize, UserData> { |
There was a problem hiding this comment.
Do you think it will be too sophisticated to put concurrency limit on individual code components and treating the cap as invariant in executor? rather than doing back-pressure from executor which will be unpredictable and awkward.
I see, several benefits of it doing it at components level: We will know exactly what part is taking more than required resource, and we will have more granular control on things like snapshot witting would not be able to block archival, etc.
Though i am not sure about practicality of it, so I am figuring that out, seeking your thoughts.
There was a problem hiding this comment.
Yeah this should probably just be a Vec. But note that the submission and completion queues are bounded (the ring in uring).
Typically this is not very large (1024 is considered large), so if we can't predict the number of iops (which I think we can't), we'll need to put a semaphore in front.
There was a problem hiding this comment.
Ah uhm no, it works a bit differently: the SQ size only limits the batch size basically, and then the kernel executes stuff until it runs out of resources. There is never submission backpressure if the CQ overflows, completions will either be dropped or just appear on the CQ later.
I think we should never use IORING_FEAT_NODROP, so either panicking or dropping CQEs seem reasonable modes for the simulator.
There was a problem hiding this comment.
I think we should never use IORING_FEAT_NODROP, so either panicking or dropping CQEs seem reasonable modes for the simulator.
Should not we put custom backpressure in submission queue to avoid both panicking and dropping CQEs in prod implementation. Which implies simulator should always be panicking in that case?
There was a problem hiding this comment.
I think dropping could still be a valuable fault injection mode, because it makes completion channels pending forever without dropping the sender.
Adds an
io-uring-compatible (file) I/O API with simulator and tokio impls.The DST runtime uses the simulator to drive I/O operations and inject failures according to a configuration. Failure injection is more or less for demonstration purposes, and may need to become more sophisticated for actual DST.
It is not yet clear how the application-facing API should look like: in any case, we will need a way to enter the runtime context.