From 7612e520f04296c77288b7800b1c6dd9de3570d0 Mon Sep 17 00:00:00 2001 From: Ksawlii Date: Tue, 19 Nov 2024 09:13:44 +0100 Subject: [PATCH] Revert "io_uring: don't save/restore iowait state" This reverts commit aa97b89f43906ed5f3f5d5d41751ccd9a287093c. --- io_uring/io_uring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 41f1124d9..5eea3a296 100755 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -7663,7 +7663,7 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx, struct io_wait_queue *iowq, ktime_t *timeout) { - int ret; + int io_wait, ret; /* make sure we run task_work before checking for signals */ ret = io_run_task_work_sig(); @@ -7678,12 +7678,13 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx, * can take into account that the task is waiting for IO - turns out * to be important for low QD IO. */ + io_wait = current->in_iowait; if (current_pending_io()) current->in_iowait = 1; ret = 1; if (!schedule_hrtimeout(timeout, HRTIMER_MODE_ABS)) ret = -ETIME; - current->in_iowait = 0; + current->in_iowait = io_wait; return ret; }