diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-10-20 16:41:18 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-20 09:56:11 -0600 |
commit | b600455d84307696b3cb7debdaf3081080748409 (patch) | |
tree | c5962f255a3720ac58dc845d28bb200f03eadb15 | |
parent | dbb6f764a079d1dea883c6f2439d91db4f0fb2f2 (diff) | |
download | linux-stable-b600455d84307696b3cb7debdaf3081080748409.tar.gz linux-stable-b600455d84307696b3cb7debdaf3081080748409.tar.bz2 linux-stable-b600455d84307696b3cb7debdaf3081080748409.zip |
block: optimise blk_flush_plug_list
Don't call flush_plug_callbacks if there are no plug callbacks.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
[hch: split from a larger patch]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211020144119.142582-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | block/blk-core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 88752e51d2b6..db8b2fe0ceaf 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -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)) |