On Fri, Feb 2, 2018 at 10:27 PM, Gregory Rose <[email protected]> wrote:
> On 2/2/2018 12:13 PM, Arnd Bergmann wrote:
>>
>> On Fri, Feb 2, 2018 at 7:31 PM, Gregory Rose <[email protected]> wrote:
>
> That's an interesting suggestion Arnd. I'm generally opposed to divide
> operations when I can avoid
> them and ktime_get_ts64() avoids that SFAICT. We do still support 32 bit
> systems as well so I think I'll
> just go ahead and stick with ktime_get_ts64.
Ok, makes sense. Just for completeness: Yes, ktime_get_ts64() avoids the
64-bit division, though you still get a 32-bit division when converting it to
milliseconds here.
On almost all architectures, we should be using the optimized do_div()
implementation these days, which will replace a 64-bit division with a constant
divisor with a set of multiplications and shifts, which tends do be much
cheaper than the full 64-bit division, so doing a ktime_to_msec() is
usually not too bad either.
Arnd
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev