Two issues here:
- Stat increment accounting was off-by-one, causing no stats added
for depth == 1
- The stat batch count should be a minimum of 2, since it's really
a mask.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
stat_nr = 0;
}
last_idx = clock_index;
- } else if (clock_index)
- stat_nr++;
+ }
+ stat_nr++;
}
reaped++;
head++;
if (stats) {
nr_batch = roundup_pow2(depth / batch_submit);
+ if (nr_batch < 2)
+ nr_batch = 2;
s->clock_batch = calloc(nr_batch, sizeof(unsigned long));
s->clock_index = 1;
stat_nr = 0;
}
last_idx = clock_index;
- } else if (clock_index)
- stat_nr++;
+ }
+ stat_nr++;
}
reaped++;
evs--;