]> git.baikalelectronics.ru Git - kernel.git/commit
blk-iolatency: only call ktime_get() if needed
authorHongnan Li <hongnan.li@linux.alibaba.com>
Wed, 1 Jul 2020 08:09:38 +0000 (16:09 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 1 Jul 2020 14:02:38 +0000 (08:02 -0600)
commit202fcc55d5e68a81c640807ba98ba020fbc967e9
tree2d90f66acae2e7111558a25e587b93cbae0dfd4e
parentc2212f4babaa0d6096c2693a69b691b63bd5fc29
blk-iolatency: only call ktime_get() if needed

ktime_to_ns(ktime_get()), which is expensive, does not need to be called
if blk_iolatency_enabled() return false in blkcg_iolatency_done_bio().
Postponing ktime_to_ns(ktime_get()) execution reduces the CPU usage when
blk_iolatency is disabled.

Signed-off-by: Hongnan Li <hongnan.li@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-iolatency.c