Skip to content

Commit ea97cbe

Browse files
committed
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: 9ca9fb2 ("io_uring: mutex locked poll hashing") Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent febb985 commit ea97cbe

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

io_uring/fdinfo.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,21 +170,29 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
170170
xa_for_each(&ctx->personalities, index, cred)
171171
io_uring_show_cred(m, index, cred);
172172
}
173-
if (has_lock)
174-
mutex_unlock(&ctx->uring_lock);
175173

176174
seq_puts(m, "PollList:\n");
177175
for (i = 0; i < (1U << ctx->cancel_table.hash_bits); i++) {
178176
struct io_hash_bucket *hb = &ctx->cancel_table.hbs[i];
177+
struct io_hash_bucket *hbl = &ctx->cancel_table_locked.hbs[i];
179178
struct io_kiocb *req;
180179

181180
spin_lock(&hb->lock);
182181
hlist_for_each_entry(req, &hb->list, hash_node)
183182
seq_printf(m, " op=%d, task_works=%d\n", req->opcode,
184183
task_work_pending(req->task));
185184
spin_unlock(&hb->lock);
185+
186+
if (!has_lock)
187+
continue;
188+
hlist_for_each_entry(req, &hbl->list, hash_node)
189+
seq_printf(m, " op=%d, task_works=%d\n", req->opcode,
190+
task_work_pending(req->task));
186191
}
187192

193+
if (has_lock)
194+
mutex_unlock(&ctx->uring_lock);
195+
188196
seq_puts(m, "CqOverflowList:\n");
189197
spin_lock(&ctx->completion_lock);
190198
list_for_each_entry(ocqe, &ctx->cq_overflow_list, list) {

0 commit comments

Comments
 (0)