Skip to content

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 requested a review from George-Miao May 12, 2024 08:21
@Berrysoft Berrysoft self-assigned this May 12, 2024
@Berrysoft Berrysoft force-pushed the refactor/reduce-eventfd-io branch from c6eb379 to bef8dda Compare May 12, 2024 08:51
@Berrysoft Berrysoft force-pushed the refactor/reduce-eventfd-io branch from 56d7ede to 0b99370 Compare May 13, 2024 06:13
@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

@Berrysoft Berrysoft requested a review from oxalica May 14, 2024 06:57
@Berrysoft Berrysoft requested a review from George-Miao May 14, 2024 07:21
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
@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