Skip to content

Commit 0917a6c

Browse files
committed
Revert "Revert "io_uring: Use io_schedule* in cqring wait""
This reverts commit 992f4fa.
1 parent 3333d45 commit 0917a6c

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

io_uring/io_uring.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
23542354
struct io_wait_queue *iowq,
23552355
ktime_t *timeout)
23562356
{
2357-
int ret;
2357+
int token, ret;
23582358
unsigned long check_cq;
23592359

23602360
/* 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,
23702370
if (check_cq & BIT(IO_CHECK_CQ_DROPPED_BIT))
23712371
return -EBADR;
23722372
}
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;
23732381
if (!schedule_hrtimeout(timeout, HRTIMER_MODE_ABS))
2374-
return -ETIME;
2375-
return 1;
2382+
ret = -ETIME;
2383+
io_schedule_finish(token);
2384+
return ret;
23762385
}
23772386

23782387
/*

0 commit comments

Comments
 (0)