aboutsummaryrefslogtreecommitdiffstats
path: root/block/cfq-iosched.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-07-20 08:54:05 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-09-30 14:29:40 -0400
commitdc72ef4ae35c2016fb594bcc85ce871376682174 (patch)
treec0c78879addf0d65adcc8f8cce01165fa2502dac /block/cfq-iosched.c
parent981a79730d586335ef8f942c83bdf2b1de6d4e3d (diff)
[PATCH] Add blk_start_queueing() helper
CFQ implements this on its own now, but it's really block layer knowledge. Tells a device queue to start dispatching requests to the driver, taking care to unplug if needed. Also fixes the issue where as/cfq will invoke a stopped queue, which we really don't want. Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r--block/cfq-iosched.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 6fb1613d44d7..9f684cc66bd1 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1553,19 +1553,6 @@ static void cfq_preempt_queue(struct cfq_data *cfqd, struct cfq_queue *cfqq)
1553} 1553}
1554 1554
1555/* 1555/*
1556 * should really be a ll_rw_blk.c helper
1557 */
1558static void cfq_start_queueing(struct cfq_data *cfqd, struct cfq_queue *cfqq)
1559{
1560 request_queue_t *q = cfqd->queue;
1561
1562 if (!blk_queue_plugged(q))
1563 q->request_fn(q);
1564 else
1565 __generic_unplug_device(q);
1566}
1567
1568/*
1569 * Called when a new fs request (rq) is added (to cfqq). Check if there's 1556 * Called when a new fs request (rq) is added (to cfqq). Check if there's
1570 * something we should do about it 1557 * something we should do about it
1571 */ 1558 */
@@ -1593,7 +1580,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1593 if (cic == cfqd->active_cic && 1580 if (cic == cfqd->active_cic &&
1594 del_timer(&cfqd->idle_slice_timer)) { 1581 del_timer(&cfqd->idle_slice_timer)) {
1595 cfq_slice_expired(cfqd, 0); 1582 cfq_slice_expired(cfqd, 0);
1596 cfq_start_queueing(cfqd, cfqq); 1583 blk_start_queueing(cfqd->queue);
1597 } 1584 }
1598 return; 1585 return;
1599 } 1586 }
@@ -1614,7 +1601,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1614 if (cfq_cfqq_wait_request(cfqq)) { 1601 if (cfq_cfqq_wait_request(cfqq)) {
1615 cfq_mark_cfqq_must_dispatch(cfqq); 1602 cfq_mark_cfqq_must_dispatch(cfqq);
1616 del_timer(&cfqd->idle_slice_timer); 1603 del_timer(&cfqd->idle_slice_timer);
1617 cfq_start_queueing(cfqd, cfqq); 1604 blk_start_queueing(cfqd->queue);
1618 } 1605 }
1619 } else if (cfq_should_preempt(cfqd, cfqq, rq)) { 1606 } else if (cfq_should_preempt(cfqd, cfqq, rq)) {
1620 /* 1607 /*
@@ -1624,7 +1611,7 @@ cfq_rq_enqueued(struct cfq_data *cfqd, struct cfq_queue *cfqq,
1624 */ 1611 */
1625 cfq_preempt_queue(cfqd, cfqq); 1612 cfq_preempt_queue(cfqd, cfqq);
1626 cfq_mark_cfqq_must_dispatch(cfqq); 1613 cfq_mark_cfqq_must_dispatch(cfqq);
1627 cfq_start_queueing(cfqd, cfqq); 1614 blk_start_queueing(cfqd->queue);
1628 } 1615 }
1629} 1616}
1630 1617
@@ -1832,8 +1819,7 @@ static void cfq_kick_queue(void *data)
1832 unsigned long flags; 1819 unsigned long flags;
1833 1820
1834 spin_lock_irqsave(q->queue_lock, flags); 1821 spin_lock_irqsave(q->queue_lock, flags);
1835 blk_remove_plug(q); 1822 blk_start_queueing(q);
1836 q->request_fn(q);
1837 spin_unlock_irqrestore(q->queue_lock, flags); 1823 spin_unlock_irqrestore(q->queue_lock, flags);
1838} 1824}
1839 1825