aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-08-24 08:57:54 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-24 13:22:44 -0400
commit9c2c38a122cc23d6a09b8004d60a33913683eedf (patch)
tree0596d9e3315a64d01f2a6f64d4f352f3cd0de08f /drivers/block
parent41290c14640bc9312bf63202d14ebef075b6171a (diff)
[PATCH] cfq-iosched.c: minor fixes
One critical fix and two minor fixes for 2.6.13-rc7: - Max depth must currently be 2 to allow barriers to function on SCSI - Prefer sync request over async in choosing the next request - Never allow async request to preempt or disturb the "anticipation" for a single cfq process context. This is as-designed, the code right now is buggy in that area. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/cfq-iosched.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c
index 2435a7c99b2..cd056e7e64e 100644
--- a/drivers/block/cfq-iosched.c
+++ b/drivers/block/cfq-iosched.c
@@ -47,7 +47,7 @@ static int cfq_slice_idle = HZ / 100;
47/* 47/*
48 * disable queueing at the driver/hardware level 48 * disable queueing at the driver/hardware level
49 */ 49 */
50static int cfq_max_depth = 1; 50static int cfq_max_depth = 2;
51 51
52/* 52/*
53 * for the hash of cfqq inside the cfqd 53 * for the hash of cfqq inside the cfqd
@@ -385,9 +385,15 @@ cfq_choose_req(struct cfq_data *cfqd, struct cfq_rq *crq1, struct cfq_rq *crq2)
385 return crq2; 385 return crq2;
386 if (crq2 == NULL) 386 if (crq2 == NULL)
387 return crq1; 387 return crq1;
388 if (cfq_crq_requeued(crq1)) 388
389 if (cfq_crq_requeued(crq1) && !cfq_crq_requeued(crq2))
389 return crq1; 390 return crq1;
390 if (cfq_crq_requeued(crq2)) 391 else if (cfq_crq_requeued(crq2) && !cfq_crq_requeued(crq1))
392 return crq2;
393
394 if (cfq_crq_is_sync(crq1) && !cfq_crq_is_sync(crq2))
395 return crq1;
396 else if (cfq_crq_is_sync(crq2) && !cfq_crq_is_sync(crq1))
391 return crq2; 397 return crq2;
392 398
393 s1 = crq1->request->sector; 399 s1 = crq1->request->sector;
@@ -1769,18 +1775,23 @@ static void
1769cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq, 1775cfq_crq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1770 struct cfq_rq *crq) 1776 struct cfq_rq *crq)
1771{ 1777{
1772 const int sync = cfq_crq_is_sync(crq); 1778 struct cfq_io_context *cic;
1773 1779
1774 cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq); 1780 cfqq->next_crq = cfq_choose_req(cfqd, cfqq->next_crq, crq);
1775 1781
1776 if (sync) { 1782 /*
1777 struct cfq_io_context *cic = crq->io_context; 1783 * we never wait for an async request and we don't allow preemption
1784 * of an async request. so just return early
1785 */
1786 if (!cfq_crq_is_sync(crq))
1787 return;
1778 1788
1779 cfq_update_io_thinktime(cfqd, cic); 1789 cic = crq->io_context;
1780 cfq_update_idle_window(cfqd, cfqq, cic);
1781 1790
1782 cic->last_queue = jiffies; 1791 cfq_update_io_thinktime(cfqd, cic);
1783 } 1792 cfq_update_idle_window(cfqd, cfqq, cic);
1793
1794 cic->last_queue = jiffies;
1784 1795
1785 if (cfqq == cfqd->active_queue) { 1796 if (cfqq == cfqd->active_queue) {
1786 /* 1797 /*