]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - block/blk-mq.c
blk-mq: optimise blk_mq_flush_plug_list()
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 28 Nov 2019 21:11:55 +0000 (00:11 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 19 Dec 2019 13:08:50 +0000 (06:08 -0700)
commit95ed0c5b1292fb90fe100af88541a7bef6ba44ec
tree05ecb68041eb6deed13fb8172d4d03372635132d
parent28ca0d6d39ab1d01c86762c82a585b7cedd2920c
blk-mq: optimise blk_mq_flush_plug_list()

Instead of using list_del_init() in a loop, that generates a lot of
unnecessary memory read/writes, iterate from the first request of a
batch and cut out a sublist with list_cut_before().

Apart from removing the list node initialisation part, this is more
register-friendly, and the assembly uses the stack less intensively.

list_empty() at the beginning is done with hope, that the compiler can
optimise out the same check in the following list_splice_init().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c