mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
418cc5abac
Commit "1fcc8a8f io_uring: Make UringContext Sync" uncovered an issue where wakeups were lost if a uring operation was added from a different thread while the executor thread was blocked inside an io_uring_enter call. To fix this, PendingOperation calls UringContext::submit whenever the pending IO is not yet completed and has not been submitted. Unfortunately, since we tend to write code like `r.read_to_vec(..).await`, this meant that we would call UringContext::submit every time after adding a new operation to the submit queue, kind of defeating the purpose of batching multiple IO ops in a single syscall. Instead only call UringContext::submit when the current thread is not the same as the executor thread. The executor will submit all pending operations anyway the next time it calls UringContext::wait so there's no need to do it from PendingOperation when it is polled on the executor thread. BUG=none TEST=unit tests Change-Id: Ia95f3844790d3392e074e3ab55a9c6ef59f29db2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2684063 Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> |
||
---|---|---|
.. | ||
src | ||
.build_test_skip | ||
Cargo.toml |