]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
time: Optimize ns_to_timespec64()
authorArnd Bergmann <arnd@arndb.de>
Fri, 8 Nov 2019 20:34:25 +0000 (21:34 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 12 Nov 2019 07:15:15 +0000 (08:15 +0100)
commit20d087368d38c7350a4519a3b316ef7eb2504692
tree100e400b1bbb4909ef54689ce1907ac6ecf4e59e
parent56144737e67329c9aaed15f942d46a6302e2e3d8
time: Optimize ns_to_timespec64()

ns_to_timespec64() calls div_s64_rem(), which is a rather slow function on
32-bit architectures, as it cannot take advantage of the do_div()
optimizations for constant arguments.

Open-code the div_s64_rem() function in ns_to_timespec64(), so a constant
divider can be passed into the optimized div_u64_rem() function.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20191108203435.112759-3-arnd@arndb.de
kernel/time/time.c