aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 2435a7c99b2b..cd056e7e64ec 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 /*