Commit ef9865a
io_uring: don't forget to task-cancel drained reqs
If there is a long-standing request of one task locking up execution of
deferred requests, and the defer list contains requests of another task
(all files-less), then a potential execution of __io_uring_task_cancel()
by that another task will sleep until that first long-standing request
completion, and that may take long.
E.g.
tsk1: req1/read(empty_pipe) -> tsk2: req(DRAIN)
Then __io_uring_task_cancel(tsk2) waits for req1 completion.
It seems we even can manufacture a complicated case with many tasks
sharing many rings that can lock them forever.
Cancel deferred requests for __io_uring_task_cancel() as well.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 99b3280 commit ef9865a
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8496 | 8496 | | |
8497 | 8497 | | |
8498 | 8498 | | |
| 8499 | + | |
8499 | 8500 | | |
8500 | 8501 | | |
8501 | 8502 | | |
8502 | 8503 | | |
8503 | 8504 | | |
8504 | 8505 | | |
8505 | 8506 | | |
8506 | | - | |
| 8507 | + | |
| 8508 | + | |
8507 | 8509 | | |
8508 | 8510 | | |
8509 | 8511 | | |
| |||
8529 | 8531 | | |
8530 | 8532 | | |
8531 | 8533 | | |
8532 | | - | |
8533 | 8534 | | |
8534 | 8535 | | |
8535 | 8536 | | |
| |||
8621 | 8622 | | |
8622 | 8623 | | |
8623 | 8624 | | |
| 8625 | + | |
| 8626 | + | |
| 8627 | + | |
| 8628 | + | |
| 8629 | + | |
8624 | 8630 | | |
8625 | 8631 | | |
8626 | 8632 | | |
| |||
0 commit comments