Revert "block, bfq: lower-bound the estimated peak rate to 1"

This reverts commit d0c2875ecb2b877366b410b3c37511cb556f9ec7.
This commit is contained in:
pwnrazr
2023-09-16 11:42:42 +08:00
committed by kondors1995
parent 9fbde5ab8a
commit 3aa1efdff4
2 changed files with 2 additions and 25 deletions

View File

@@ -187,20 +187,7 @@ static struct kmem_cache *bfq_pool;
/* Target observation time interval for a peak-rate update (ns) */
#define BFQ_RATE_REF_INTERVAL NSEC_PER_SEC
/*
* Shift used for peak-rate fixed precision calculations.
* With
* - the current shift: 16 positions
* - the current type used to store rate: u32
* - the current unit of measure for rate: [sectors/usec], or, more precisely,
* [(sectors/usec) / 2^BFQ_RATE_SHIFT] to take into account the shift,
* the range of rates that can be stored is
* [1 / 2^BFQ_RATE_SHIFT, 2^(32 - BFQ_RATE_SHIFT)] sectors/usec =
* [1 / 2^16, 2^16] sectors/usec = [15e-6, 65536] sectors/usec =
* [15, 65G] sectors/sec
* Which, assuming a sector size of 512B, corresponds to a range of
* [7.5K, 33T] B/sec
*/
/* Shift used for peak rate fixed precision calculations. */
#define BFQ_RATE_SHIFT 16
/*
@@ -2599,16 +2586,6 @@ static void bfq_update_rate_reset(struct bfq_data *bfqd, struct request *rq)
rate /= divisor; /* smoothing constant alpha = 1/divisor */
bfqd->peak_rate += rate;
/*
* For a very slow device, bfqd->peak_rate can reach 0 (see
* the minimum representable values reported in the comments
* on BFQ_RATE_SHIFT). Push to 1 if this happens, to avoid
* divisions by zero where bfqd->peak_rate is used as a
* divisor.
*/
bfqd->peak_rate = max_t(u32, 1, bfqd->peak_rate);
update_thr_responsiveness_params(bfqd);
reset_computation:

View File

@@ -497,7 +497,7 @@ struct bfq_data {
u64 delta_from_first;
/*
* Current estimate of the device peak rate, measured in
* [(sectors/usec) / 2^BFQ_RATE_SHIFT]. The left-shift by
* [BFQ_RATE_SHIFT * sectors/usec]. The left-shift by
* BFQ_RATE_SHIFT is performed to increase precision in
* fixed-point calculations.
*/