tree 653e92ba3b9b19cbfe0d86d64d573eab7886b193
parent 975e046cc06005bafe0c5ce81d55a1b1eb84f5a1
author Ken Chen <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:25:43 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:25:43 -0700

[PATCH] use cheaper elv_queue_empty when unplug a device

In function __generic_unplug_device(), kernel can use a cheaper function
elv_queue_empty() instead of more expensive elv_next_request to find
whether the queue is empty or not.  blk_run_queue can also made conditional
on whether queue's emptiness before calling request_fn().

Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
Signed-off-by: Ken Chen <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

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

Index: drivers/block/ll_rw_blk.c
===================================================================
--- 6e95047664d5d5e2006a753449122cd6e7e32002/drivers/block/ll_rw_blk.c  
(mode:100644 sha1:2d6934a028674fb0df6ed187643686159cdacc84)
+++ 653e92ba3b9b19cbfe0d86d64d573eab7886b193/drivers/block/ll_rw_blk.c  
(mode:100644 sha1:46e54b441663d501c33944e46411117af9c4da40)
@@ -1589,7 +1589,8 @@
 
        spin_lock_irqsave(q->queue_lock, flags);
        blk_remove_plug(q);
-       q->request_fn(q);
+       if (!elv_queue_empty(q))
+               q->request_fn(q);
        spin_unlock_irqrestore(q->queue_lock, flags);
 }
 EXPORT_SYMBOL(blk_run_queue);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to