

We presently auto-unplug a queue when either

a) It has been plugged for three milliseconds (rarely happens) or

b) There are four requests queued.

Arjan suggests that we should also unplug if there is a single, full-sized
request on the queue.  Nothing will be able to merge with this request, so we
may as well let it rip.


---

 drivers/block/ll_rw_blk.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN drivers/block/ll_rw_blk.c~blk-unplug-when-max-request-queued drivers/block/ll_rw_blk.c
--- 25/drivers/block/ll_rw_blk.c~blk-unplug-when-max-request-queued	2004-03-02 18:18:44.000000000 -0800
+++ 25-akpm/drivers/block/ll_rw_blk.c	2004-03-02 18:18:44.000000000 -0800
@@ -2153,7 +2153,8 @@ out:
 	if (blk_queue_plugged(q)) {
 		int nr_queued = q->rq.count[READ] + q->rq.count[WRITE];
 
-		if (nr_queued == q->unplug_thresh)
+		if (nr_queued == q->unplug_thresh ||
+				req->nr_sectors == q->max_sectors)
 			__generic_unplug_device(q);
 	}
 	spin_unlock_irq(q->queue_lock);

_
