[PATCH] optimize ktime_divns for constant divisors

Robert Jarzmik robert.jarzmik at free.fr
Wed Dec 3 12:16:27 PST 2014


Nicolas Pitre <nicolas.pitre at linaro.org> writes:

> 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.

Hi Nicolas,

I suppose the "small enough" is linked to the "!(div >> 32)" in your patch.  Can
I have the rationale which brought up this value, and if that value is universal
across architectures (ie. x86/ppc/arm/...) ?

And when you say "much faster", do you have figures to add to your commit
message ?

Cheers.

--
Robert



More information about the linux-arm-kernel mailing list