aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2010-03-19 03:03:04 -0400
committerJens Axboe <jens.axboe@oracle.com>2010-03-19 03:03:04 -0400
commite9ce335df51ff782035a15c261a3c0c9892a1767 (patch)
tree9ecb3c0eab9dbb0117ad9d726456850ff2f49b78
parent910ac735bad53ce54741a72a5b19ab69794ae069 (diff)
cfq-iosched: fix a kbuild regression
Alex Shi reported a kbuild regression which is about 10% performance lost. He bisected to this commit: 3dde36ddea3e07dd025c4c1ba47edec91606fec0. The reason is cfqq_close() can't find close cooperator. Restoring cfq_rq_close()'s threshold to original value makes the regression go away. Since for_preempt parameter isn't used anymore, this patch deletes it. Reported-by: Alex Shi <alex.shi@intel.com> Signed-off-by: Shaohua Li <shaohua.li@intel.com> Acked-by: Corrado Zoccolo <czoccolo@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-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;