提交 a2997382 编写于 作者: K Ken Chen 提交者: Linus Torvalds

[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: NJens Axboe <axboe@suse.de>
Signed-off-by: NKen Chen <kenneth.w.chen@intel.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 975e046c
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册