8000 util/poll: `kqueue` support by iliasotnikov · Pull Request #11050 · ofiwg/libfabric · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

util/poll: kqueue support #11050

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

Merged
merged 1 commit into from
May 27, 2025
Merged

Conversation

iliasotnikov
Copy link
Contributor

The change adds kqueue support and allows scalable polling when epoll is not available for a platform.

Signed-off-by: Ilia Sotnikov isotnikov@vdura.com

@iliasotnikov iliasotnikov force-pushed the feat/kqueue-support branch from a1ebaa6 to c3b5c3a Compare May 21, 2025 12:52
Comment on lines +62 to +59
#define OFI_EPOLL_EVT_HAS_INPUT(evt) evt.filter == EVFILT_READ
#define OFI_EPOLL_EVT_HAS_OUTPUT(evt) evt.filter == EVFILT_WRITE
#define OFI_EPOLL_EVT_HAS_ERR(evt) evt.flags & EV_ERROR
#define OFI_EPOLL_EVT_DATA(evt) evt.udata
#define OFI_EPOLL_EVT_EVENTS(evt) evt.filter
Copy link
Contributor

Choose a reason for hiding this comment

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

These macros need to be defined for the else branch as well.

Copy link
Contributor Author
@iliasotnikov iliasotnikov May 22, 2025

Choose a reason for hiding this comment

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

thanks - for both epoll and poll those are defined in L50-56 - didn't want to introduce more duplication than necessary. Please do let me know if you'd like those explicitly defined in corresponding #ifdef branches to ease of understanding.

Copy link
Contributor
@j-xiong j-xiong May 22, 2025

Choose a reason for hiding this comment

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

I would reorganize these definitions as:

#ifdef HAVE_KQUEUE
L62-66
#else
L51-55
#endif

updated the line number to match the code shown here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the hint - I went further and reorganized ofi_epoll.h so there is only one single conditional around each HAVE_EPOLL and HAVE_KQUEUE, which hopefully would improve readability.

@j-xiong
Copy link
Contributor
j-xiong commented May 21, 2025

Please squash the commits and add a component prefix to the commit title line, e.g. util/epoll: Add kqueue support.

FYI, you can update the original commit and push with -f flag.

@iliasotnikov iliasotnikov force-pushed the feat/kqueue-support branch from c3b5c3a to 21716dd Compare May 22, 2025 08:04
@iliasotnikov iliasotnikov changed the title kqueue support util/poll: kqueue support May 22, 2025
@iliasotnikov iliasotnikov force-pushed the feat/kqueue-support branch from 21716dd to 59ad1d9 Compare May 22, 2025 12:56
@iliasotnikov
Copy link
Contributor Author

Please squash the commits and add a component prefix to the commit title line, e.g. util/epoll: Add kqueue support.

FYI, you can update the original commit and push with -f flag.

Done, thanks for the suggestion!

@j-xiong
Copy link
Contributor
j-xiong commented May 22, 2025

Thanks for the update. For the commit title, I mean changing the title of the commit itself. The PR title line is fine w/ or w/o the change.

@iliasotnikov iliasotnikov force-pushed the feat/kqueue-support branch from 59ad1d9 to a4bb096 Compare May 22, 2025 15:53
@iliasotnikov
Copy link
Contributor Author

Thanks for the update. For the commit title, I mean changing the title of the commit itself. The PR title line is fine w/ or w/o the change.

oh, sorry for for that - I've updated the commit heading, thanks!

The change adds `kqueue` support and allows scalable polling when
`epoll` is not available for a platform.

Signed-off-by: Ilia Sotnikov <isotnikov@vdura.com>
@iliasotnikov iliasotnikov force-pushed the feat/kqueue-support branch from a4bb096 to 17743c8 Compare May 23, 2025 11:34
@j-xiong j-xiong merged commit 9b61c3b into ofiwg:main May 27, 2025
13 checks passed
@iliasotnikov iliasotnikov deleted the feat/kqueue-support branch May 27, 2025 07:13
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
0