Skip to content

Commit 7d8d001

Browse files
osandovaxboe
authored andcommitted
blk-stat: fix blk_stat_sum() if all samples are batched
We need to flush the batch _before_ we check the number of samples, otherwise we'll miss all of the batched samples. Fixes: cf43e6b ("block: add scalable completion tracking of requests") Signed-off-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent 97da385 commit 7d8d001

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎block/blk-stat.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ static void blk_stat_flush_batch(struct blk_rq_stat *stat)
3030

3131
static void blk_stat_sum(struct blk_rq_stat *dst, struct blk_rq_stat *src)
3232
{
33+
blk_stat_flush_batch(src);
34+
3335
if (!src->nr_samples)
3436
return;
3537

36-
blk_stat_flush_batch(src);
37-
3838
dst->min = min(dst->min, src->min);
3939
dst->max = max(dst->max, src->max);
4040

0 commit comments

Comments
 (0)