[PATCH 4/7] io_uring/poll: don't claim real exclusivity for EPOLLEXCLUSIVE

From: Linus Torvalds

Date: Tue Nov 24 2026 - 12:45:39 EST


From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 23 Nov 2026 16:47:49 -0800
Subject: [PATCH 4/7] 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@xxxxxxxxxxxx>
Cc: Jens Axboe <axboe@xxxxxxxxx>
Cc: Oleg Nesterov <oleg@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Juri Lelli <juri.lelli@xxxxxxxxxx>
Cc: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
---
io_uring/poll.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

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,
--
2.56.0.313.g975a75ca90