[PATCH 0/2] blk-throttle: minor cleanups
From: Tao Cui
Date: Tue Jul 14 2026 - 06:30:58 EST
From: Tao Cui <cuitao@xxxxxxxxxx>
This short series collects two independent, behavior-preserving cleanups
to the blk-throttle policy.
Patch 1 reworks calculate_bytes_allowed() to short-circuit a zero
jiffy_elapsed explicitly, rather than relying on ilog2(0) == -1
(fls64(0) - 1) to skip the overflow guard. __tg_update_carryover()
reaches it with a zero elapsed time right after a slice starts.
Patch 2 factors the four identical rbps/wbps/riops/wiops print blocks
in tg_prfill_limit() into a small helper and drops two alias locals.
Neither changes behavior; the io.max seq_file output is unchanged. Built
and boot-tested in QEMU (cgroup v2 io.max read-back matches, throttled IO
completes without warning/oops).
Tao Cui (2):
blk-throttle: avoid ilog2(0) in calculate_bytes_allowed()
blk-throttle: factor out limit field printing in tg_prfill_limit()
block/blk-throttle.c | 52 ++++++++++++++++++++------------------------
1 file changed, 23 insertions(+), 29 deletions(-)
--
2.43.0