Skip to content

Commit 6f0974e

Browse files
committed
io_uring: don't save/restore iowait state
This kind of state is per-syscall, and since we're doing the waiting off entering the io_uring_enter(2) syscall, there's no way that iowait can already be set for this case. Simplify it by setting it if we need to, and always clearing it to 0 when done. Fixes: 7b72d66 ("io_uring: gate iowait schedule on having pending requests") Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 045395d commit 6f0974e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

io_uring/io_uring.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,7 @@ static bool current_pending_io(void)
25392539
static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
25402540
struct io_wait_queue *iowq)
25412541
{
2542-
int io_wait, ret;
2542+
int ret;
25432543

25442544
if (unlikely(READ_ONCE(ctx->check_cq)))
25452545
return 1;
@@ -2557,15 +2557,14 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
25572557
* can take into account that the task is waiting for IO - turns out
25582558
* to be important for low QD IO.
25592559
*/
2560-
io_wait = current->in_iowait;
25612560
if (current_pending_io())
25622561
current->in_iowait = 1;
25632562
ret = 0;
25642563
if (iowq->timeout == KTIME_MAX)
25652564
schedule();
25662565
else if (!schedule_hrtimeout(&iowq->timeout, HRTIMER_MODE_ABS))
25672566
ret = -ETIME;
2568-
current->in_iowait = io_wait;
2567+
current->in_iowait = 0;
25692568
return ret;
25702569
}
25712570

0 commit comments

Comments
 (0)