You need to sign in or sign up before continuing.
提交 ea97cbeb 编写于 作者: J Jens Axboe

io_uring/fdinfo: include locked hash table in fdinfo output

A previous commit split the hash table for polled requests into two
parts, but didn't get the fdinfo output updated. This means that it's
less useful for debugging, as we may think a given request is not pending
poll.

Fix this up by dumping the locked hash table contents too.

Fixes: 9ca9fb24 ("io_uring: mutex locked poll hashing")
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 febb985c
...@@ -170,12 +170,11 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, ...@@ -170,12 +170,11 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
xa_for_each(&ctx->personalities, index, cred) xa_for_each(&ctx->personalities, index, cred)
io_uring_show_cred(m, index, cred); io_uring_show_cred(m, index, cred);
} }
if (has_lock)
mutex_unlock(&ctx->uring_lock);
seq_puts(m, "PollList:\n"); seq_puts(m, "PollList:\n");
for (i = 0; i < (1U << ctx->cancel_table.hash_bits); i++) { for (i = 0; i < (1U << ctx->cancel_table.hash_bits); i++) {
struct io_hash_bucket *hb = &ctx->cancel_table.hbs[i]; struct io_hash_bucket *hb = &ctx->cancel_table.hbs[i];
struct io_hash_bucket *hbl = &ctx->cancel_table_locked.hbs[i];
struct io_kiocb *req; struct io_kiocb *req;
spin_lock(&hb->lock); spin_lock(&hb->lock);
...@@ -183,8 +182,17 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, ...@@ -183,8 +182,17 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
seq_printf(m, " op=%d, task_works=%d\n", req->opcode, seq_printf(m, " op=%d, task_works=%d\n", req->opcode,
task_work_pending(req->task)); task_work_pending(req->task));
spin_unlock(&hb->lock); spin_unlock(&hb->lock);
if (!has_lock)
continue;
hlist_for_each_entry(req, &hbl->list, hash_node)
seq_printf(m, " op=%d, task_works=%d\n", req->opcode,
task_work_pending(req->task));
} }
if (has_lock)
mutex_unlock(&ctx->uring_lock);
seq_puts(m, "CqOverflowList:\n"); seq_puts(m, "CqOverflowList:\n");
spin_lock(&ctx->completion_lock); spin_lock(&ctx->completion_lock);
list_for_each_entry(ocqe, &ctx->cq_overflow_list, list) { list_for_each_entry(ocqe, &ctx->cq_overflow_list, list) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册