File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2354,7 +2354,7 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
2354
2354
struct io_wait_queue * iowq ,
2355
2355
ktime_t * timeout )
2356
2356
{
2357
- int ret ;
2357
+ int token , ret ;
2358
2358
unsigned long check_cq ;
2359
2359
2360
2360
/* make sure we run task_work before checking for signals */
@@ -2370,9 +2370,18 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
2370
2370
if (check_cq & BIT (IO_CHECK_CQ_DROPPED_BIT ))
2371
2371
return - EBADR ;
2372
2372
}
2373
+
2374
+ /*
2375
+ * Use io_schedule_prepare/finish, so cpufreq can take into account
2376
+ * that the task is waiting for IO - turns out to be important for low
2377
+ * QD IO.
2378
+ */
2379
+ token = io_schedule_prepare ();
2380
+ ret = 1 ;
2373
2381
if (!schedule_hrtimeout (timeout , HRTIMER_MODE_ABS ))
2374
- return - ETIME ;
2375
- return 1 ;
2382
+ ret = - ETIME ;
2383
+ io_schedule_finish (token );
2384
+ return ret ;
2376
2385
}
2377
2386
2378
2387
/*
You can’t perform that action at this time.
0 commit comments