block/blk-stat: fix mean loss when re-summing aggregated stats - #46
Open
blktests-ci-block-trial[bot] wants to merge 1 commit into
Open
block/blk-stat: fix mean loss when re-summing aggregated stats#46blktests-ci-block-trial[bot] wants to merge 1 commit into
blktests-ci-block-trial[bot] wants to merge 1 commit into
Conversation
blk_rq_stat_sum() folds src into dst but only advances dst->mean and dst->nr_samples, leaving dst->batch untouched. The mean is computed from src->batch (the raw per-cpu sum), so a stat that has already been through one sum carries batch=0; if that aggregated stat is then used as the src of another sum, its samples add nothing to the new mean. iolatency hits exactly that: iolatency_check_latencies() first sums the per-cpu stats into a local stat, then sums that local stat into iolat->cur_stat. After the first sum the local stat has batch=0, so every later window drives cur_stat->mean toward zero. On non-SSD devices it stays at 0, making the latency_sum_ok(&cur_stat) check that gates scaling up always true -- the scale-up hysteresis is effectively defeated. SSD devices use the percentile path and are unaffected. Keep dst->batch in sync across sums so an aggregated stat can be reused as a src. blk_rq_stat.batch is internal to blk_rq_stat_init/_add/_sum (no other reader in the tree), so the wbt and blk-mq consumers, which only read ->mean/->min/->nr_samples, behave as before. Fixes: 34dbad5 ("blk-stat: convert to callback-based statistics reporting") 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/blk-stat: fix mean loss when re-summing aggregated stats
version: 1
url: http://redsun45:8000/project/linux-block/list/?series=383