aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-06-28 03:04:01 -0400
committerJens Axboe <axboe@fb.com>2016-06-28 10:21:48 -0400
commit149321a611d5d41cebcf5f813a3bf45b3afe66ad (patch)
tree55b2dcd151cd40b622c2c5e41d29d6cb1f38960e
parent93fdf1478aaba6c397ba54f4cc534bf5019831b4 (diff)
cfq-iosched: Fix regression in bonnie++ rewrite performance
Commit 9a7f38c42c2 (cfq-iosched: Convert from jiffies to nanoseconds) broke the condition for detecting starved sync IO in cfq_completed_request() because rq->start_time remained in jiffies but we compared it with nanosecond values. This manifested as a regression in bonnie++ rewrite performance because we always ended up considering sync IO starved and thus never increased async IO queue depth. Since rq->start_time is used in a lot of places, converting it to ns values would be non-trivial. So just revert the condition in CFQ to use comparison with jiffies. This will lead to suboptimal results if cfq_fifo_expire[1] will ever come close to 1 jiffie but so far we are relatively far from that with the storage used with CFQ (the default value is 128 ms). Fixes: 9a7f38c42c2b92391d9dabaf9f51df7cfe5608e4 Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--block/cfq-iosched.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index c1adbd01d0fa..2d03004dc77c 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -4243,7 +4243,16 @@ static void cfq_completed_request(struct request_queue *q, struct request *rq)
4243 cfqq_type(cfqq)); 4243 cfqq_type(cfqq));
4244 4244
4245 st->ttime.last_end_request = now; 4245 st->ttime.last_end_request = now;
4246 if (!(rq->start_time + cfqd->cfq_fifo_expire[1] > now)) 4246 /*
4247 * We have to do this check in jiffies since start_time is in
4248 * jiffies and it is not trivial to convert to ns. If
4249 * cfq_fifo_expire[1] ever comes close to 1 jiffie, this test
4250 * will become problematic but so far we are fine (the default
4251 * is 128 ms).
4252 */
4253 if (!time_after(rq->start_time +
4254 nsecs_to_jiffies(cfqd->cfq_fifo_expire[1]),
4255 jiffies))
4247 cfqd->last_delayed_sync = now; 4256 cfqd->last_delayed_sync = now;
4248 } 4257 }
4249 4258