]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Provide high precision conversion from ns,us,ms -> sbintime in kevent
authorgibbs <gibbs@FreeBSD.org>
Sat, 12 Mar 2016 23:02:53 +0000 (23:02 +0000)
committergibbs <gibbs@FreeBSD.org>
Sat, 12 Mar 2016 23:02:53 +0000 (23:02 +0000)
commit453fdfd69aa20f2cf9af21523062f42236269f73
treee8fdbe2776ce60793d24c1590fcbc4ae1d7989ed
parenteeddd376ff2271d2ee40373d9226e40097392c45
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
sys/kern/kern_event.c