Skip to content

Load the epoll_pwait2 availability flag once per wait - #24026

Open
bukka wants to merge 1 commit into
php:PHP-8.6from
bukka:poll_epoll_fallback
Open

bukka wants to merge 1 commit into
php:PHP-8.6from
bukka:poll_epoll_fallback

Conversation

@bukka

@bukka bukka commented Sep 30, 2026

Copy link
Copy Markdown
Member

The fallback added in #23825 tested the atomic flag twice on every wait, since the compiler cannot assume it did not change in between, and marked the epoll_wait() path unexpected although it is taken on every wait once the kernel has answered ENOSYS. The two calls are now the branches of one if/else with a goto from the ENOSYS case into the fallback branch, and the branch hints are gone.

The fallback added in php#23825 tested the atomic flag twice on every wait,
since the compiler cannot assume it did not change in between, and marked
the epoll_wait() path unexpected although it is taken on every wait once
the kernel has answered ENOSYS. The two calls are now the branches of one
if/else with a goto from the ENOSYS case into the fallback branch, and the
branch hints are gone.

@TimWolla TimWolla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Could possibly avoid the duplicated epoll_wait() duplication with some creative brace placement.

@bukka

bukka commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Could possibly avoid the duplicated epoll_wait() duplication with some creative brace placement.

I tried it but it was a bit ugly... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants