summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-06-28 10:04:02 +0300
committerJens Axboe <axboe@fb.com>2016-06-28 17:21:50 +0300
commit0b31c10c667b774e6d373c8f1146c93cff21a0cd (patch)
treeb0f97fc830aa349da4c46f6874f8a24888b5fa71 /block
parent149321a611d5d41cebcf5f813a3bf45b3afe66ad (diff)
downloadlinux-0b31c10c667b774e6d373c8f1146c93cff21a0cd.tar.xz
cfq-iosched: Charge at least 1 jiffie instead of 1 ns
Commit 9a7f38c42c2b (cfq-iosched: Convert from jiffies to nanoseconds) could result in charging just 1 ns to a cgroup submitting IO instead of 1 jiffie we always charged before. It is arguable what is the right amount to change but for now lets retain the old behavior of always charging at least one jiffie. Fixes: 9a7f38c42c2b92391d9dabaf9f51df7cfe5608e4 Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/cfq-iosched.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 2d03004dc77c..892afd6d40e2 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1463,7 +1463,8 @@ static inline u64 cfq_cfqq_slice_usage(struct cfq_queue *cfqq,
* a single request on seeky media and cause lots of seek time
* and group will never know it.
*/
- slice_used = max_t(u64, (now - cfqq->dispatch_start), 1);
+ slice_used = max_t(u64, (now - cfqq->dispatch_start),
+ jiffies_to_nsecs(1));
} else {
slice_used = now - cfqq->slice_start;
if (slice_used > cfqq->allocated_slice) {