block: drain per-cpu latency stats over possible CPUs - #44
Open
blktests-ci-block-trial[bot] wants to merge 4 commits into
Open
block: drain per-cpu latency stats over possible CPUs#44blktests-ci-block-trial[bot] wants to merge 4 commits into
blktests-ci-block-trial[bot] wants to merge 4 commits into
Conversation
added 4 commits
July 22, 2026 11:52
blk_stat_timer_fn() sums and resets a callback's per-cpu buckets using for_each_online_cpu(). A CPU that goes offline with pending samples is skipped, so its samples are neither accumulated into the window nor cleared; they sit in the bucket until the CPU comes back online, at which point the stale values are flushed into whatever window is then running. This silently corrupts the latency picture that consumers (notably writeback throttling via wbt, and blk-mq latency tracking) base decisions on around CPU hotplug: under-counting while the CPU is offline, then a burst of stale data on re-online. Fixes: 34dbad5 ("blk-stat: convert to callback-based statistics reporting") Signed-off-by: Tao Cui <cuitao@kylinos.cn>
iolatency_check_latencies() and iolatency_ssd_stat() iterate a blkg's per-cpu latency stats with for_each_online_cpu(). When a CPU that has accumulated io.latency samples goes offline, its bucket is skipped: the check loop (which also resets) neither sums nor clears it, and the show path under-reports. On re-online the stranded samples are flushed into a later check window, which can trigger a spurious throttle/scale adjustment. Fixes: d706751 ("block: introduce blk-iolatency io controller") Fixes: 1fa2840 ("blk-iolatency: use a percentile approache for ssd's") Signed-off-by: Tao Cui <cuitao@kylinos.cn>
ioc_lat_stat() walks ioc->pcpu_stat with for_each_online_cpu() to compute missed-ppm and rq_wait deltas. An offlined CPU is skipped, so its delta is dropped from the period and its last_* watermark is not advanced; on re-online the next collection sees a delta spanning the whole offline interval, corrupting the latency/vrate picture. Fixes: 7caa471 ("blkcg: implement blk-iocost") Signed-off-by: Tao Cui <cuitao@kylinos.cn>
kyber_timer_fn() sums the per-cpu latency histograms with for_each_online_cpu(). A CPU that goes offline mid-interval leaves its bucket un-flushed; the samples are lost from the current decision and re-appear (stale) when the CPU is onlined again. Fixes: 6e25cb0 ("kyber: implement improved heuristics") Signed-off-by: Tao Cui <cuitao@kylinos.cn>
Author
|
Upstream branch: 248951d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: block: drain per-cpu latency stats over possible CPUs
version: 1
url: http://redsun45:8000/project/linux-block/list/?series=380