Commit c653b1a50661 for kernel
commit c653b1a50661d1e936952c64f2825dc79486bdad
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Mon Nov 23 16:47:49 2026 -0800
io_uring/poll: don't claim real exclusivity for EPOLLEXCLUSIVE
Same problem as epoll: an EPOLLEXCLUSIVE poll request returns 1 from
io_poll_wake() (even when it lost the ownership race and does nothing),
which stops the wakeup walk, but posting a CQE doesn't consume the
event.
Waiters queued behind it can sleep with the event pending.
Use WQ_FLAG_POLL_EXCLUSIVE, so only one io_uring entry is woken but real
waiters are not skipped.
Reported-by: Mani Tofigh <mt4022@columbia.edu>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
diff --git a/io_uring/poll.c b/io_uring/poll.c
index fc1800c7097b..67bf39575238 100644
--- a/io_uring/poll.c
+++ b/io_uring/poll.c
@@ -533,11 +533,9 @@ static void __io_queue_proc(struct io_poll *poll, struct io_poll_table *pt,
poll->head = head;
poll->wait.private = (void *) wqe_private;
- if (poll->events & EPOLLEXCLUSIVE) {
- add_wait_queue_exclusive(head, &poll->wait);
- } else {
- add_wait_queue(head, &poll->wait);
- }
+ if (poll->events & EPOLLEXCLUSIVE)
+ poll->wait.flags |= WQ_FLAG_POLL_EXCLUSIVE;
+ add_wait_queue(head, &poll->wait);
}
static void io_poll_queue_proc(struct file *file, struct wait_queue_head *head,