diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2014-12-03 22:43:06 +0300 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2015-01-24 04:21:31 +0300 |
commit | 8b618628b2bf83512fc8df5e8672619d65adfdfb (patch) | |
tree | c295bed4f4e702f5f39fcce622258e55242b1d93 /include/linux/timekeeping.h | |
parent | eaa27f34e91a14cdceed26ed6c6793ec1d186115 (diff) | |
download | linux-8b618628b2bf83512fc8df5e8672619d65adfdfb.tar.xz |
ktime: Optimize ktime_divns for constant divisors
At least on ARM, do_div() is optimized to turn constant divisors into
an inline multiplication by the reciprocal value at compile time.
However this optimization is missed entirely whenever ktime_divns() is
used and the slow out-of-line division code is used all the time.
Let ktime_divns() use do_div() inline whenever the divisor is constant
and small enough. This will make things like ktime_to_us() and
ktime_to_ms() much faster.
Cc: Arnd Bergmann <arnd.bergmann@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Nicolas Pitre <nico@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'include/linux/timekeeping.h')
0 files changed, 0 insertions, 0 deletions