[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240905092645.2885200-9-christian.loehle@arm.com>
Date: Thu, 5 Sep 2024 10:26:45 +0100
From: Christian Loehle <christian.loehle@....com>
To: linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
rafael@...nel.org,
peterz@...radead.org
Cc: juri.lelli@...hat.com,
mingo@...hat.com,
dietmar.eggemann@....com,
vschneid@...hat.com,
vincent.guittot@...aro.org,
Johannes.Thumshirn@....com,
adrian.hunter@...el.com,
ulf.hansson@...aro.org,
bvanassche@....org,
andres@...razel.de,
asml.silence@...il.com,
linux-block@...r.kernel.org,
io-uring@...r.kernel.org,
qyousef@...alina.io,
dsmythies@...us.net,
axboe@...nel.dk,
Christian Loehle <christian.loehle@....com>
Subject: [RFC PATCH 8/8] io_uring: Do not set iowait before sleeping
Setting in_iowait was introduced in commit
8a796565cec3 ("io_uring: Use io_schedule* in cqring wait")
to tackle a perf regression that was caused by menu taking iowait into
account for synchronous IO and thus not selecting deeper states like in
the io_uring counterpart.
That behaviour is gone, so the workaround can be removed.
Signed-off-by: Christian Loehle <christian.loehle@....com>
---
io_uring/io_uring.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 3942db160f18..c819d40bdcf0 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -2341,15 +2341,6 @@ int io_run_task_work_sig(struct io_ring_ctx *ctx)
return 0;
}
-static bool current_pending_io(void)
-{
- struct io_uring_task *tctx = current->io_uring;
-
- if (!tctx)
- return false;
- return percpu_counter_read_positive(&tctx->inflight);
-}
-
/* when returns >0, the caller should retry */
static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
struct io_wait_queue *iowq)
@@ -2367,19 +2358,11 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx,
if (unlikely(io_should_wake(iowq)))
return 0;
- /*
- * Mark us as being in io_wait if we have pending requests, so cpufreq
- * can take into account that the task is waiting for IO - turns out
- * to be important for low QD IO.
- */
- if (current_pending_io())
- current->in_iowait = 1;
ret = 0;
if (iowq->timeout == KTIME_MAX)
schedule();
else if (!schedule_hrtimeout(&iowq->timeout, HRTIMER_MODE_ABS))
ret = -ETIME;
- current->in_iowait = 0;
return ret;
}
--
2.34.1
Powered by blists - more mailing lists