On 6/23/23 1:04?PM, Andres Freund wrote: > Hi, > > I'd been chatting with Jens about this, so obviously I'm interested in the > feature... > > On 2023-06-09 12:31:24 -0600, Jens Axboe wrote: >> Add support for FUTEX_WAKE/WAIT primitives. >> >> IORING_OP_FUTEX_WAKE is mix of FUTEX_WAKE and FUTEX_WAKE_BITSET, as >> it does support passing in a bitset. >> >> Similary, IORING_OP_FUTEX_WAIT is a mix of FUTEX_WAIT and >> FUTEX_WAIT_BITSET. > > One thing I was wondering about is what happens when there are multiple > OP_FUTEX_WAITs queued for the same futex, and that futex gets woken up. I > don't really have an opinion about what would be best, just that it'd be > helpful to specify the behaviour. Not sure I follow the question, can you elaborate? If you have N futex waits on the same futex and someone does a wait (with wakenum >= N), then they'd all wake and post a CQE. If less are woken because the caller asked for less than N, than that number should be woken. IOW, should have the same semantics as "normal" futex waits. Or maybe I'm totally missing what is being asked here... -- Jens Axboe