diff options
author | Ken Chen <kenneth.w.chen@intel.com> | 2005-04-16 18:25:43 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:25:43 -0400 |
commit | a299738283a654544c75167d190d9e87b77e5fb7 (patch) | |
tree | 653e92ba3b9b19cbfe0d86d64d573eab7886b193 /drivers/block/ll_rw_blk.c | |
parent | 975e046cc06005bafe0c5ce81d55a1b1eb84f5a1 (diff) |
[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 <axboe@suse.de>
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/ll_rw_blk.c')
-rw-r--r-- | drivers/block/ll_rw_blk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 2d6934a02867..46e54b441663 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c | |||
@@ -1589,7 +1589,8 @@ void blk_run_queue(struct request_queue *q) | |||
1589 | 1589 | ||
1590 | spin_lock_irqsave(q->queue_lock, flags); | 1590 | spin_lock_irqsave(q->queue_lock, flags); |
1591 | blk_remove_plug(q); | 1591 | blk_remove_plug(q); |
1592 | q->request_fn(q); | 1592 | if (!elv_queue_empty(q)) |
1593 | q->request_fn(q); | ||
1593 | spin_unlock_irqrestore(q->queue_lock, flags); | 1594 | spin_unlock_irqrestore(q->queue_lock, flags); |
1594 | } | 1595 | } |
1595 | EXPORT_SYMBOL(blk_run_queue); | 1596 | EXPORT_SYMBOL(blk_run_queue); |