diff options
-rw-r--r-- | block/blk-throttle.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index a46700255719..c1bc1b6c887a 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c | |||
@@ -439,8 +439,7 @@ static bool tg_with_in_iops_limit(struct throtl_data *td, struct throtl_grp *tg, | |||
439 | 439 | ||
440 | jiffy_elapsed_rnd = roundup(jiffy_elapsed_rnd, throtl_slice); | 440 | jiffy_elapsed_rnd = roundup(jiffy_elapsed_rnd, throtl_slice); |
441 | 441 | ||
442 | io_allowed = (tg->iops[rw] * jiffies_to_msecs(jiffy_elapsed_rnd)) | 442 | io_allowed = (tg->iops[rw] * jiffy_elapsed_rnd) / HZ; |
443 | / MSEC_PER_SEC; | ||
444 | 443 | ||
445 | if (tg->io_disp[rw] + 1 <= io_allowed) { | 444 | if (tg->io_disp[rw] + 1 <= io_allowed) { |
446 | if (wait) | 445 | if (wait) |
@@ -476,8 +475,8 @@ static bool tg_with_in_bps_limit(struct throtl_data *td, struct throtl_grp *tg, | |||
476 | 475 | ||
477 | jiffy_elapsed_rnd = roundup(jiffy_elapsed_rnd, throtl_slice); | 476 | jiffy_elapsed_rnd = roundup(jiffy_elapsed_rnd, throtl_slice); |
478 | 477 | ||
479 | tmp = tg->bps[rw] * jiffies_to_msecs(jiffy_elapsed_rnd); | 478 | tmp = tg->bps[rw] * jiffy_elapsed_rnd; |
480 | do_div(tmp, MSEC_PER_SEC); | 479 | do_div(tmp, HZ); |
481 | bytes_allowed = tmp; | 480 | bytes_allowed = tmp; |
482 | 481 | ||
483 | if (tg->bytes_disp[rw] + bio->bi_size <= bytes_allowed) { | 482 | if (tg->bytes_disp[rw] + bio->bi_size <= bytes_allowed) { |