Skip to content

Commit

Permalink
cfq-iosched: Charge at least 1 jiffie instead of 1 ns
Browse files Browse the repository at this point in the history
Commit 9a7f38c (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: 9a7f38c
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
jankara authored and axboe committed Jun 28, 2016
1 parent 149321a commit 0b31c10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/cfq-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0b31c10

Please sign in to comment.