aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 3fd8afc2174e..423aee3fd19b 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -47,6 +47,7 @@ static const int cfq_hist_divisor = 4;
47#define CFQ_SERVICE_SHIFT 12 47#define CFQ_SERVICE_SHIFT 12
48 48
49#define CFQQ_SEEK_THR (sector_t)(8 * 100) 49#define CFQQ_SEEK_THR (sector_t)(8 * 100)
50#define CFQQ_SECT_THR_NONROT (sector_t)(2 * 32)
50#define CFQQ_SEEKY(cfqq) (hweight32(cfqq->seek_history) > 32/8) 51#define CFQQ_SEEKY(cfqq) (hweight32(cfqq->seek_history) > 32/8)
51 52
52#define RQ_CIC(rq) \ 53#define RQ_CIC(rq) \
@@ -2965,6 +2966,7 @@ cfq_update_io_seektime(struct cfq_data *cfqd, struct cfq_queue *cfqq,
2965 struct request *rq) 2966 struct request *rq)
2966{ 2967{
2967 sector_t sdist = 0; 2968 sector_t sdist = 0;
2969 sector_t n_sec = blk_rq_sectors(rq);
2968 if (cfqq->last_request_pos) { 2970 if (cfqq->last_request_pos) {
2969 if (cfqq->last_request_pos < blk_rq_pos(rq)) 2971 if (cfqq->last_request_pos < blk_rq_pos(rq))
2970 sdist = blk_rq_pos(rq) - cfqq->last_request_pos; 2972 sdist = blk_rq_pos(rq) - cfqq->last_request_pos;
@@ -2973,7 +2975,10 @@ cfq_update_io_seektime(struct cfq_data *cfqd, struct cfq_queue *cfqq,
2973 } 2975 }
2974 2976
2975 cfqq->seek_history <<= 1; 2977 cfqq->seek_history <<= 1;
2976 cfqq->seek_history |= (sdist > CFQQ_SEEK_THR); 2978 if (blk_queue_nonrot(cfqd->queue))
2979 cfqq->seek_history |= (n_sec < CFQQ_SECT_THR_NONROT);
2980 else
2981 cfqq->seek_history |= (sdist > CFQQ_SEEK_THR);
2977} 2982}
2978 2983
2979/* 2984/*