File tree 1 file changed +12
-5
lines changed 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -147,11 +147,18 @@ __cold void io_uring_show_fdinfo(struct seq_file *m, struct file *f)
147
147
if (has_lock && (ctx -> flags & IORING_SETUP_SQPOLL )) {
148
148
struct io_sq_data * sq = ctx -> sq_data ;
149
149
150
- sq_pid = sq -> task_pid ;
151
- sq_cpu = sq -> sq_cpu ;
152
- getrusage (sq -> thread , RUSAGE_SELF , & sq_usage );
153
- sq_total_time = sq_usage .ru_stime .tv_sec * 1000000 + sq_usage .ru_stime .tv_usec ;
154
- sq_work_time = sq -> work_time ;
150
+ /*
151
+ * sq->thread might be NULL if we raced with the sqpoll
152
+ * thread termination.
153
+ */
154
+ if (sq -> thread ) {
155
+ sq_pid = sq -> task_pid ;
156
+ sq_cpu = sq -> sq_cpu ;
157
+ getrusage (sq -> thread , RUSAGE_SELF , & sq_usage );
158
+ sq_total_time = (sq_usage .ru_stime .tv_sec * 1000000
159
+ + sq_usage .ru_stime .tv_usec );
160
+ sq_work_time = sq -> work_time ;
161
+ }
155
162
}
156
163
157
164
seq_printf (m , "SqThread:\t%d\n" , sq_pid );
You can’t perform that action at this time.
0 commit comments