Linux cgroups development
 help / color / mirror / Atom feed
* [PATCH] blk-throttle: schedule parent dispatch in tg_flush_bios()
@ 2026-05-20  6:24 Tao Cui
  2026-05-20 12:33 ` Shin'ichiro Kawasaki
  0 siblings, 1 reply; 8+ messages in thread
From: Tao Cui @ 2026-05-20  6:24 UTC (permalink / raw)
  To: tj, josef, axboe, cgroups; +Cc: linux-block, Tao Cui

tg_flush_bios() schedules pending_timer on the child tg's own
service_queue, which causes throtl_pending_timer_fn() to dispatch from
the child's pending_tree.  For leaf cgroups this tree is empty, so the
timer fires and exits without dispatching the throttled bio.

The throttled bio sits in the parent's pending_tree with disptime set
to jiffies (THROTL_TG_CANCELING zeroes all dispatch times), but the
parent's timer is never explicitly rescheduled.  The bio only gets
dispatched when the parent timer eventually fires at its previously
scheduled expiry.

Fix by calling throtl_schedule_next_dispatch(sq->parent_sq, true)
instead, matching what tg_set_limit() already does.  This forces the
parent's dispatch cycle to run immediately and flush all canceling
bios without waiting for a stale timer.

Signed-off-by: Tao Cui <cuitao@kylinos.cn>
---
 block/blk-throttle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 2d39977ba9de..0ad30b688ce1 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1652,7 +1652,7 @@ static void tg_flush_bios(struct throtl_grp *tg)
 	 */
 	tg_update_disptime(tg);
 
-	throtl_schedule_pending_timer(sq, jiffies + 1);
+	throtl_schedule_next_dispatch(sq->parent_sq, true);
 }
 
 static void throtl_pd_offline(struct blkg_policy_data *pd)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-21  9:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-20  6:24 [PATCH] blk-throttle: schedule parent dispatch in tg_flush_bios() Tao Cui
2026-05-20 12:33 ` Shin'ichiro Kawasaki
2026-05-20 14:20   ` Tao Cui
2026-05-20 23:39     ` Shin'ichiro Kawasaki
2026-05-21  2:54       ` Tao Cui
2026-05-21  4:54         ` Shin'ichiro Kawasaki
2026-05-21  7:54           ` Tao Cui
2026-05-21  9:04           ` Tao Cui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox