summaryrefslogtreecommitdiffstats
path: root/block/blk-throttle.c
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2010-10-01 21:16:38 +0200
committerJens Axboe <jaxboe@fusionio.com>2010-10-01 21:16:38 +0200
commit5e901a2b95db709c5e40599ff4df6029be1e2a12 (patch)
treee2450a1157c6f9411429fceb9939002d8c0282f8 /block/blk-throttle.c
parent3aad5d3ee4e4fce8f4b5bb6ca73342dcade42b33 (diff)
downloadblackbird-obmc-linux-5e901a2b95db709c5e40599ff4df6029be1e2a12.tar.gz
blackbird-obmc-linux-5e901a2b95db709c5e40599ff4df6029be1e2a12.zip
blkio-throttle: There is no need to convert jiffies to milli seconds
o Do not convert jiffies to mili seconds as it is not required. Just work with jiffies and HZ. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'block/blk-throttle.c')
-rw-r--r--block/blk-throttle.c7
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,
jiffy_elapsed_rnd = roundup(jiffy_elapsed_rnd, throtl_slice);
- io_allowed = (tg->iops[rw] * jiffies_to_msecs(jiffy_elapsed_rnd))
- / MSEC_PER_SEC;
+ io_allowed = (tg->iops[rw] * jiffy_elapsed_rnd) / HZ;
if (tg->io_disp[rw] + 1 <= io_allowed) {
if (wait)
@@ -476,8 +475,8 @@ static bool tg_with_in_bps_limit(struct throtl_data *td, struct throtl_grp *tg,
jiffy_elapsed_rnd = roundup(jiffy_elapsed_rnd, throtl_slice);
- tmp = tg->bps[rw] * jiffies_to_msecs(jiffy_elapsed_rnd);
- do_div(tmp, MSEC_PER_SEC);
+ tmp = tg->bps[rw] * jiffy_elapsed_rnd;
+ do_div(tmp, HZ);
bytes_allowed = tmp;
if (tg->bytes_disp[rw] + bio->bi_size <= bytes_allowed) {
OpenPOWER on IntegriCloud