Commit b600455d authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

block: optimise blk_flush_plug_list

Don't call flush_plug_callbacks if there are no plug callbacks.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
[hch: split from a larger patch]
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211020144119.142582-4-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent dbb6f764
......@@ -1639,8 +1639,8 @@ EXPORT_SYMBOL(blk_check_plugged);
void blk_flush_plug_list(struct blk_plug *plug, bool from_schedule)
{
flush_plug_callbacks(plug, from_schedule);
if (!list_empty(&plug->cb_list))
flush_plug_callbacks(plug, from_schedule);
if (!rq_list_empty(plug->mq_list))
blk_mq_flush_plug_list(plug, from_schedule);
if (unlikely(!from_schedule && plug->cached_rq))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment