From: Tejun Heo The cfq-cfq-elevator_insert_back-fix.patch contains a bug which is triggered if force dispatching (back insertion) occurs when the active cfqq is in idle slice while there exist other requests on other cfqqs. In this case, the idle slice timer is removed without invoking the timer handler, so CFQ itself doesn't run the queue. Also, as the queue wasn't empty when the elv_add_request() is invoked, the blk layer won't kick the queue on return. This results in queue stall. This patch removes the stall by kicking the queue after force dispatching. Signed-off-by: Tejun Heo Signed-off-by: Andrew Morton --- drivers/block/cfq-iosched.c | 8 ++++++++ 1 files changed, 8 insertions(+) diff -puN drivers/block/cfq-iosched.c~cfq-cfq-elevator_insert_back-fix-fix drivers/block/cfq-iosched.c --- 25/drivers/block/cfq-iosched.c~cfq-cfq-elevator_insert_back-fix-fix 2005-05-31 02:44:12.000000000 -0700 +++ 25-akpm/drivers/block/cfq-iosched.c 2005-05-31 02:44:12.000000000 -0700 @@ -1712,6 +1712,14 @@ cfq_insert_request(request_queue_t *q, s while (cfq_dispatch_requests(q, INT_MAX, 1)) ; list_add_tail(&rq->queuelist, &q->queue_head); + /* + * If we were idling with pending requests on + * inactive cfqqs, force dispatching will + * remove the idle timer and the queue won't + * be kicked by __make_request() afterward. + * Kick it here. + */ + kblockd_schedule_work(&cfqd->unplug_work); break; case ELEVATOR_INSERT_FRONT: list_add(&rq->queuelist, &q->queue_head); _