mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 12:34:31 +00:00
1fcc8a8f3c
Rather than requiring callers to wrap the entire UringContext in a big lock, make UringContext Sync by internally using fine-grained locks: * The submit queue is wrapped with a Mutex so that threads may still add operations to the submit queue even when a thread is blocked inside an io_uring_enter call. * The completion queue internally uses a Mutex around the pending op data and completed count so that two threads don't end up trying to remove the same operation from the completed queue. With this we can enable the await_uring_from_poll test. This test uncovered missing wakeups in the case where a uring operation is added from one thread while the main uring thread is blocked inside an io_uring_enter syscall. To deal with this, we call submit() whenever the pending operation is polled and not yet submitted. BUG=none TEST=unit tests Change-Id: I4c7dec65c03b7b10014f4a84d2cd16fe8758ea72 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2643842 Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> |
||
---|---|---|
.. | ||
src | ||
.build_test_skip | ||
Cargo.toml |