io_uring/wait: make check for pending io consider cached task references
PATCH 1/1 io_uring/wait: make check for pending io consider cached task references
The io_uring task's inflight count also includes the reservations for task references from io_task_refs_refill(), not just in-flight requests. Thus, pending requests are present if the inflight count is larger than the number of cached references.
--- io_uring/wait.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
io_uring/wait.c +7 -1
@@ -48,7 +48,13 @@ static bool current_pending_io(void)if (!tctx)return false; -return percpu_counter_read_positive (&tctx->inflight); +/* +* tctx->inflight also includes the reservations for task references +* from io_task_refs_refill(), not just in-flight requests. Thus, +* pending requests are present if the inflight count is larger than the +* number of cached references. +*/ +return percpu_counter_read_positive (&tctx->inflight) > tctx->cached_refs; }static enum hrtimer_restart io_cqring_timer_wakeup (struct hrtimer *timer)
Signature · 1 line
2.47.3
Jens Axboe
maintainerQuoted 8 lines · Fiona Ebner
The
io_uringtask's inflight count also includes the reservations for task references fromio_task_refs_refill(), not just in-flight requests. Thus, pending requests are present if the inflight count is larger than the number of cached references.Co-developed-by Thomas Lamprecht <[email protected]>Signed-off-by Thomas Lamprecht <[email protected]>Signed-off-by Fiona Ebner <[email protected]>
Looks go to me! Just needs:
tags added, I will do that. Thanks for debugging this and sending a fix.
Signature · 1 line
Jens Axboe
Am 27.04.26 um 7:17 PM schrieb Jens Axboe:
Quoted 10 lines · Fiona Ebner
Quoted 8 lines
The
io_uringtask's inflight count also includes the reservations for task references fromio_task_refs_refill(), not just in-flight requests. Thus, pending requests are present if the inflight count is larger than the number of cached references.Co-developed-by Thomas Lamprecht <[email protected]>Signed-off-by Thomas Lamprecht <[email protected]>Signed-off-by Fiona Ebner <[email protected]>
Quoted 7 lines
Looks go to me! Just needs:
Fixes 7b72d661f1f2 ("io_uring: gate iowait schedule on having pending requests")tags added, I will do that. Thanks for debugging this and sending a fix.
Thank you!
Hi Jens,
Am 28.04.26 um 11:52 AM schrieb Fiona Ebner:
Quoted 13 lines
Am 27.04.26 um 7:17 PM schrieb Jens Axboe:
Quoted 12 lines · Fiona Ebner
Quoted 8 lines
The
io_uringtask's inflight count also includes the reservations for task references fromio_task_refs_refill(), not just in-flight requests. Thus, pending requests are present if the inflight count is larger than the number of cached references.Co-developed-by Thomas Lamprecht <[email protected]>Signed-off-by Thomas Lamprecht <[email protected]>Signed-off-by Fiona Ebner <[email protected]>Looks go to me! Just needs:
Quoted 7 lines
Quoted 5 lines
Fixes 7b72d661f1f2 ("io_uring: gate iowait schedule on having pending requests")tags added, I will do that. Thanks for debugging this and sending a fix.
Thank you!
it seems like this change did not yet land in mainline kernels. Should I resend with the added tags? Or is there some remaining issue with the change?
Best Regards,
Fiona