mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-23 22:34:21 +08:00
io_uring: disable draining earlier
Clear ->drain_active in two more cases where we check for a need of draining. It's not a bug, but still may lead to some extra requests being punted to io-wq, and that may be not desirable. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/d20b265f77bb4e8860b15b9987252c7c711dfcba.1632516769.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
a1cdbb4cb5
commit
5e371265ea
@ -6461,8 +6461,10 @@ static bool io_drain_req(struct io_kiocb *req)
|
|||||||
|
|
||||||
seq = io_get_sequence(req);
|
seq = io_get_sequence(req);
|
||||||
/* Still a chance to pass the sequence check */
|
/* Still a chance to pass the sequence check */
|
||||||
if (!req_need_defer(req, seq) && list_empty_careful(&ctx->defer_list))
|
if (!req_need_defer(req, seq) && list_empty_careful(&ctx->defer_list)) {
|
||||||
|
ctx->drain_active = false;
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
ret = io_req_prep_async(req);
|
ret = io_req_prep_async(req);
|
||||||
if (ret)
|
if (ret)
|
||||||
@ -6481,6 +6483,7 @@ fail:
|
|||||||
spin_unlock(&ctx->completion_lock);
|
spin_unlock(&ctx->completion_lock);
|
||||||
kfree(de);
|
kfree(de);
|
||||||
io_queue_async_work(req, NULL);
|
io_queue_async_work(req, NULL);
|
||||||
|
ctx->drain_active = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user