]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
commit6e2fa4dd683a22a7697e7ff51dad499406094d28
tree2d90f66acae2e7111558a25e587b93cbae0dfd4e
parent5a6c35f9af416114588298aa7a90b15bbed15a41
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