aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/cfq-iosched.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index dee9d9378fee..8d5a2f2f7fb9 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_CLOSE_THR (sector_t)(8 * 1024)
50#define CFQQ_SECT_THR_NONROT (sector_t)(2 * 32) 51#define CFQQ_SECT_THR_NONROT (sector_t)(2 * 32)
51#define CFQQ_SEEKY(cfqq) (hweight32(cfqq->seek_history) > 32/8) 52#define CFQQ_SEEKY(cfqq) (hweight32(cfqq->seek_history) > 32/8)
52 53
@@ -1660,9 +1661,9 @@ static inline sector_t cfq_dist_from_last(struct cfq_data *cfqd,
1660} 1661}
1661 1662
1662static inline int cfq_rq_close(struct cfq_data *cfqd, struct cfq_queue *cfqq, 1663static inline int cfq_rq_close(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1663 struct request *rq, bool for_preempt) 1664 struct request *rq)
1664{ 1665{
1665 return cfq_dist_from_last(cfqd, rq) <= CFQQ_SEEK_THR; 1666 return cfq_dist_from_last(cfqd, rq) <= CFQQ_CLOSE_THR;
1666} 1667}
1667 1668
1668static struct cfq_queue *cfqq_close(struct cfq_data *cfqd, 1669static struct cfq_queue *cfqq_close(struct cfq_data *cfqd,
@@ -1689,7 +1690,7 @@ static struct cfq_queue *cfqq_close(struct cfq_data *cfqd,
1689 * will contain the closest sector. 1690 * will contain the closest sector.
1690 */ 1691 */
1691 __cfqq = rb_entry(parent, struct cfq_queue, p_node); 1692 __cfqq = rb_entry(parent, struct cfq_queue, p_node);
1692 if (cfq_rq_close(cfqd, cur_cfqq, __cfqq->next_rq, false)) 1693 if (cfq_rq_close(cfqd, cur_cfqq, __cfqq->next_rq))
1693 return __cfqq; 1694 return __cfqq;
1694 1695
1695 if (blk_rq_pos(__cfqq->next_rq) < sector) 1696 if (blk_rq_pos(__cfqq->next_rq) < sector)
@@ -1700,7 +1701,7 @@ static struct cfq_queue *cfqq_close(struct cfq_data *cfqd,
1700 return NULL; 1701 return NULL;
1701 1702
1702 __cfqq = rb_entry(node, struct cfq_queue, p_node); 1703 __cfqq = rb_entry(node, struct cfq_queue, p_node);
1703 if (cfq_rq_close(cfqd, cur_cfqq, __cfqq->next_rq, false)) 1704 if (cfq_rq_close(cfqd, cur_cfqq, __cfqq->next_rq))
1704 return __cfqq; 1705 return __cfqq;
1705 1706
1706 return NULL; 1707 return NULL;
@@ -3103,7 +3104,7 @@ cfq_should_preempt(struct cfq_data *cfqd, struct cfq_queue *new_cfqq,
3103 * if this request is as-good as one we would expect from the 3104 * if this request is as-good as one we would expect from the
3104 * current cfqq, let it preempt 3105 * current cfqq, let it preempt
3105 */ 3106 */
3106 if (cfq_rq_close(cfqd, cfqq, rq, true)) 3107 if (cfq_rq_close(cfqd, cfqq, rq))
3107 return true; 3108 return true;
3108 3109
3109 return false; 3110 return false;