[PATCH 2.6.12-rc5-mm1] CFQ: fix stall on force dispatch

From: Tejun Heo
Date: Sat May 28 2005 - 21:55:37 EST


Hello, Jens.
Hello, Andrew.

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 <htejun@xxxxxxxxx>

Index: blk-fixes/drivers/block/cfq-iosched.c
===================================================================
--- blk-fixes.orig/drivers/block/cfq-iosched.c 2005-05-29 11:29:51.000000000 +0900
+++ blk-fixes/drivers/block/cfq-iosched.c 2005-05-29 11:29:54.000000000 +0900
@@ -1705,6 +1705,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);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/