Skip to content
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

feat(driver): reduce eventfd IO #250

Merged
merged 12 commits into from
May 14, 2024

Conversation

Berrysoft
Copy link
Member

@Berrysoft Berrysoft commented May 12, 2024

Each call to Waker::wake writes to the eventfd, which is too annoying. This PR provides a faster path. When the waker is on the same thread, no need to write to the eventfd.

The enable_poll switch of proactor builder provides compatibility to custom event loops, which may poll the io-uring fd in other frameworks. When the switch is enabled, the fast path is disabled.

@Berrysoft Berrysoft added driver: io-uring About the io-uring driver package: driver Related to compio-driver refactor Refactoring existing code labels May 12, 2024
@Berrysoft Berrysoft self-assigned this May 12, 2024
@Berrysoft
Copy link
Member Author

Thanks to @oxalica, this PR also address two small fixes:

  • min_timeout gets current time even when no timeout in the queue.
  • Add a local queue to the runtime to reduce sync cost of SegQueue

compio-runtime/src/runtime/mod.rs Outdated Show resolved Hide resolved
compio-runtime/src/runtime/mod.rs Outdated Show resolved Hide resolved
@Berrysoft Berrysoft requested a review from oxalica May 14, 2024 06:57
Copy link
Member

@George-Miao George-Miao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@George-Miao George-Miao added the performance Performance related (regression/optimization) label May 14, 2024
@Berrysoft Berrysoft merged commit 49e4be9 into compio-rs:master May 14, 2024
29 checks passed
@Berrysoft Berrysoft deleted the refactor/reduce-eventfd-io branch May 14, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
driver: io-uring About the io-uring driver package: driver Related to compio-driver performance Performance related (regression/optimization) refactor Refactoring existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants