Repository navigation
Use futex2_wake for io_uring waker - #312
Conversation
io_uring's FUTEX_WAIT uses the FUTEX2 kernel interface, so we need to use futex2_wake instead of the old futex syscall to wake it. Wake all waiters instead of just one - the kernel appears to leave stale waiters in the futex hash table when io_uring rings are closed, causing subsequent wakes to target the wrong waiter.
📝 WalkthroughWalkthroughThe wake() function in the io_uring backend switches from a single-target futex WAKE syscall to a futex2_wake call that wakes all waiters. The new implementation uses FUTEX_BITSET_MATCH_ANY matching, updated flags for 32-bit private futex semantics, and an effectively infinite timeout. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
futex2_wakeinstead of old futex syscall to wake io_uring's FUTEX_WAIT (which uses FUTEX2 interface)Test plan
./check.sh- all tests passsync.future.test.Future: multiple waiterstest now passes reliably