]> git.itanic.dy.fi Git - linux-stable/commit
io_uring/poll: don't enable lazy wake for POLLEXCLUSIVE
authorJens Axboe <axboe@kernel.dk>
Wed, 13 Dec 2023 15:58:15 +0000 (08:58 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 13 Dec 2023 15:58:15 +0000 (08:58 -0700)
commit595e52284d24adc376890d3fc93bdca4707d9aca
tree7648aeef9e7ca87c0e2b9be537cf68dee084478d
parent705318a99a138c29a512a72c3e0043b3cd7f55f4
io_uring/poll: don't enable lazy wake for POLLEXCLUSIVE

There are a few quirks around using lazy wake for poll unconditionally,
and one of them is related the EPOLLEXCLUSIVE. Those may trigger
exclusive wakeups, which wake a limited number of entries in the wait
queue. If that wake number is less than the number of entries someone is
waiting for (and that someone is also using DEFER_TASKRUN), then we can
get stuck waiting for more entries while we should be processing the ones
we already got.

If we're doing exclusive poll waits, flag the request as not being
compatible with lazy wakeups.

Reported-by: Pavel Begunkov <asml.silence@gmail.com>
Fixes: 6ce4a93dbb5b ("io_uring/poll: use IOU_F_TWQ_LAZY_WAKE for wakeups")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/poll.c