Skip to content

Commit

Permalink
[PATCH] use cheaper elv_queue_empty when unplug a device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ken Chen authored and Linus Torvalds committed Apr 16, 2005
1 parent 975e046 commit a299738
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,8 @@ void blk_run_queue(struct request_queue *q)

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);
Expand Down

0 comments on commit a299738

Please sign in to comment.