summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-03-11 13:30:43 -0600
committerSasha Levin <sashal@kernel.org>2024-03-26 18:20:07 -0400
commite627c433c83d543d75e06fa72021f7a401c4992f (patch)
treeaf60b3015038c4cf47e28086ce5b2fdce4ae53dc /io_uring
parent2584d6bbc2bca1819059907990fcbec8228b2090 (diff)
downloadlinux-e627c433c83d543d75e06fa72021f7a401c4992f.tar.gz
linux-e627c433c83d543d75e06fa72021f7a401c4992f.tar.bz2
linux-e627c433c83d543d75e06fa72021f7a401c4992f.zip
io_uring: don't save/restore iowait state
[ Upstream commit 6f0974eccbf78baead1735722c4f1ee3eb9422cd ] 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: 7b72d661f1f2 ("io_uring: gate iowait schedule on having pending requests") Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 049a163d0fdd..25e289332034 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2501,7 +2501,7 @@ static bool current_pending_io(void)
static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
struct io_wait_queue *iowq)
{
- int io_wait, ret;
+ int ret;
if (unlikely(READ_ONCE(ctx->check_cq)))
return 1;
@@ -2519,7 +2519,6 @@ 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 = 0;
@@ -2527,7 +2526,7 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
schedule();
else if (!schedule_hrtimeout(&iowq->timeout, HRTIMER_MODE_ABS))
ret = -ETIME;
- current->in_iowait = io_wait;
+ current->in_iowait = 0;
return ret;
}