HomeFreeBSD

Provide high precision conversion from ns,us,ms -> sbintime in kevent

Description

Provide high precision conversion from ns,us,ms -> sbintime in kevent

In timer2sbintime(), calculate the second and fractional second portions of
the sbintime separately. When calculating the the fractional second portion,
use a 64bit multiply to prevent excess truncation. This avoids the ~7% error
in the original conversion for ns, and smaller errors of the same type for us
and ms.

PR: 198139
Reviewed by: jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D5397

Details

Provenance
gibbsAuthored on
Reviewer
jhb
Differential Revision
D5397: Provide high precision conversion from ns,us,ms -> sbintime in kevent
Parents
rS296774: Regen.
Branches
Unknown
Tags
Unknown