mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
io_uring: ease timeout flush locking requirements
We don't need completion_lock for timeout flushing, don't take it. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/1e3dc657975ac445b80e7bdc40050db783a5935a.1670002973.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
6971253f07
commit
e5f30f6fb2
2 changed files with 4 additions and 7 deletions
|
@ -572,12 +572,11 @@ static void io_eventfd_flush_signal(struct io_ring_ctx *ctx)
|
||||||
|
|
||||||
void __io_commit_cqring_flush(struct io_ring_ctx *ctx)
|
void __io_commit_cqring_flush(struct io_ring_ctx *ctx)
|
||||||
{
|
{
|
||||||
if (ctx->off_timeout_used || ctx->drain_active) {
|
if (ctx->off_timeout_used)
|
||||||
|
io_flush_timeouts(ctx);
|
||||||
|
if (ctx->drain_active) {
|
||||||
spin_lock(&ctx->completion_lock);
|
spin_lock(&ctx->completion_lock);
|
||||||
if (ctx->off_timeout_used)
|
io_queue_deferred(ctx);
|
||||||
io_flush_timeouts(ctx);
|
|
||||||
if (ctx->drain_active)
|
|
||||||
io_queue_deferred(ctx);
|
|
||||||
spin_unlock(&ctx->completion_lock);
|
spin_unlock(&ctx->completion_lock);
|
||||||
}
|
}
|
||||||
if (ctx->has_evfd)
|
if (ctx->has_evfd)
|
||||||
|
|
|
@ -50,7 +50,6 @@ static inline void io_put_req(struct io_kiocb *req)
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool io_kill_timeout(struct io_kiocb *req, int status)
|
static bool io_kill_timeout(struct io_kiocb *req, int status)
|
||||||
__must_hold(&req->ctx->completion_lock)
|
|
||||||
__must_hold(&req->ctx->timeout_lock)
|
__must_hold(&req->ctx->timeout_lock)
|
||||||
{
|
{
|
||||||
struct io_timeout_data *io = req->async_data;
|
struct io_timeout_data *io = req->async_data;
|
||||||
|
@ -70,7 +69,6 @@ static bool io_kill_timeout(struct io_kiocb *req, int status)
|
||||||
}
|
}
|
||||||
|
|
||||||
__cold void io_flush_timeouts(struct io_ring_ctx *ctx)
|
__cold void io_flush_timeouts(struct io_ring_ctx *ctx)
|
||||||
__must_hold(&ctx->completion_lock)
|
|
||||||
{
|
{
|
||||||
u32 seq;
|
u32 seq;
|
||||||
struct io_timeout *timeout, *tmp;
|
struct io_timeout *timeout, *tmp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue