diff options
author | Jakub Kicinski <kuba@kernel.org> | 2025-06-12 10:08:24 -0700 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2025-06-19 13:00:24 -0700 |
commit | 62deb67fc519ee3b394f094982851d1ff3992731 (patch) | |
tree | 3ae0fb80b4e8b2a539e053f6258564d8f6eba916 /io_uring/fdinfo.c | |
parent | afc783fa0aab9cc093fbb04871bfda406480cf8d (diff) | |
parent | 5c8013ae2e86ec36b07500ba4cacb14ab4d6f728 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Cross-merge networking fixes after downstream PR (net-6.16-rc3).
No conflicts or adjacent changes.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'io_uring/fdinfo.c')
-rw-r--r-- | io_uring/fdinfo.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c index e9355276ab5d..9798d6fb4ec7 100644 --- a/io_uring/fdinfo.c +++ b/io_uring/fdinfo.c @@ -141,18 +141,26 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m) if (ctx->flags & IORING_SETUP_SQPOLL) { struct io_sq_data *sq = ctx->sq_data; + struct task_struct *tsk; + rcu_read_lock(); + tsk = rcu_dereference(sq->thread); /* * sq->thread might be NULL if we raced with the sqpoll * thread termination. */ - if (sq->thread) { + if (tsk) { + get_task_struct(tsk); + rcu_read_unlock(); + getrusage(tsk, RUSAGE_SELF, &sq_usage); + put_task_struct(tsk); sq_pid = sq->task_pid; sq_cpu = sq->sq_cpu; - getrusage(sq->thread, RUSAGE_SELF, &sq_usage); sq_total_time = (sq_usage.ru_stime.tv_sec * 1000000 + sq_usage.ru_stime.tv_usec); sq_work_time = sq->work_time; + } else { + rcu_read_unlock(); } } |