-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Backport v3.4-branch] posix: eventfd: fix waking up poll() #59639
Conversation
Fix a regression introduced by commit e6eb0a7 ("posix: eventfd: revise locking, signaling, and allocation"), which was a complete rewrite stating that: The `wait_q` and `k_poll_signal` entries were removed from `struct eventfd` as they were unnecessary. In fact, `k_poll_signal` (both `read_sig` and `write_sig`) were used to wake-up blocking `poll()` invocation in another thread. This is no longer the case now, i.e. `poll(..., POLLIN)` does not return after calling `eventfd_write()` on the observed (polled) FD. Fix this regression by bringing back `read_sig` and `write_sig` to very similar state as it was before. Fixes: e6eb0a7 ("posix: eventfd: revise locking, signaling, and allocation") Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev> (cherry picked from commit 44d61bd)
Make sure that `poll(..., POLLIN)` executed from another thread returns when `eventfd_write()` is called. Test also the same with `poll(..., POLLOUT)` and `eventfd_read()` on eventfd with counter equal to `UINT64_MAX - 1`. Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev> (cherry picked from commit 2bc980f)
@cfriedt can you check out the CI failures if you get a chance? |
@jgl-meta - the TLS issue can likely be fixed by a separate MbedTLS backport The aarch64 crashes are yet another backport, not sure which one will fix those, cc @carlocaione |
Any updates on this? It's a critical fix for a project I'm currently working on. |
Since the argument is a 32-bit unsigned int, all possible values satisfy the condition that intval < UINT64_MAX - 1. Remove the redundant conditional. Signed-off-by: Christopher Friedt <cfriedt@meta.com>
@RicArch97 - this might still depend on the backport of #61455 (#61614) |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
@cfriedt Please look into this. |
I am already, thanks for the reminders. |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
Backport 2bc980f~2..2bc980f from #59505.
Fixes: #59577