]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: fix stuck fallback reqs
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 30 Jun 2021 20:54:03 +0000 (21:54 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 1 Jul 2021 19:40:17 +0000 (13:40 -0600)
commit42cf65d9c2bb86a9f1481106c638cb7edeae1a77
treeadf37b6e077ca6e39a75257f4854a257087962d0
parentbe6c01b410c3a4421091df339b1f53215d0a4e37
io_uring: fix stuck fallback reqs

When task_work_add() fails, we use ->exit_task_work to queue the work.
That will be run only in the cancellation path, which happens either
when the ctx is dying or one of tasks with inflight requests is exiting
or executing. There is a good chance that such a request would just get
stuck in the list potentially hodling a file, all io_uring rsrc
recycling or some other resources. Nothing terrible, it'll go away at
some point, but we don't want to lock them up for longer than needed.

Replace that hand made ->exit_task_work with delayed_work + llist
inspired by fput_many().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c