Commit d120fcb
io_uring: fix spurious drain flushing
BugLink: https://bugs.launchpad.net/bugs/2119603
[ Upstream commit fde04c7e2775feb0746301e0ef86a04d3598c3fe ]
io_queue_deferred() is not tolerant to spurious calls not completing
some requests. You can have an inflight drain-marked request and another
request that came after and got queued into the drain list. Now, if
io_queue_deferred() is called before the first request completes, it'll
check the 2nd req with req_need_defer(), find that there is no drain
flag set, and queue it for execution.
To make io_queue_deferred() work, it should at least check sequences for
the first request, and then we need also need to check if there is
another drain request creating another bubble.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/972bde11b7d4ef25b3f5e3fd34f80e4d2aa345b8.1746788718.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com>
Signed-off-by: Mehmet Basaran <mehmet.basaran@canonical.com>1 parent c647ee2 commit d120fcb
1 file changed
+13
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
536 | 543 | | |
537 | 544 | | |
| 545 | + | |
| 546 | + | |
538 | 547 | | |
539 | 548 | | |
540 | 549 | | |
541 | 550 | | |
542 | 551 | | |
543 | | - | |
| 552 | + | |
| 553 | + | |
544 | 554 | | |
| 555 | + | |
545 | 556 | | |
546 | 557 | | |
547 | 558 | | |
| 559 | + | |
548 | 560 | | |
549 | 561 | | |
550 | 562 | | |
| |||
0 commit comments