HomeFreeBSD

kern_tc.c/cputick2usec() (which is used to calculate cputime from

Description

kern_tc.c/cputick2usec() (which is used to calculate cputime from
cpu ticks) has some imprecision and, worse, huge timestep (about
20 minutes on 4GHz CPU) near 53.4 days of elapsed time.

kern_time.c/cputick2timespec() (it is used for clock_gettime() for
querying process or thread consumed cpu time) Uses cputick2usec()
and then needlessly converting usec to nsec, obviously losing
precision even with fixed cputick2usec().

kern_time.c/kern_clock_getres() uses some weird (anyway wrong)
formula for getting cputick resolution.

PR: 262215
Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D34558

Details

Provenance
firk_cantconnect.ruAuthored on Mar 21 2022, 1:33 PM
gnnCommitted on Mar 21 2022, 1:33 PM
Reviewer
gnn
Differential Revision
D34558: Fix imprecisions and timestep in cputime counters
Parents
rGcab496e16cb3: Make SHMMAXPGS an unsigned long
Branches
Unknown
Tags
Unknown