OpenGrok
Cross Reference: subr_time_arith.c
xref
: /
src
/
sys
/
kern
/
subr_time_arith.c
Home
|
History
|
Annotate
|
Download
|
only in
kern
History log of
/src/sys/kern/subr_time_arith.c
Revision
Date
Author
Comments
1.3
01-Apr-2025
riastradh
branches: 1.3.4;
itimer(9): Fix various bugs in arithmetic.
The arithmetic still spuriously rejects very large inputs, but we
don't have to deal with them for another century, so I'll do that in
a separate commit later without too much urgency.
In particular, when the clock reads later than the year 2262, we
can't represent it in a signed 64-bit number of nanoseconds since
1970. It is possible to compute a two-digit mixed-radix 96-bit
quotient and remainder in struct timespec arithmetic, but it's a lot
more trouble to write out the details.
In particular, even if we limit intervals to be positive 63-bit
numbers of nanoseconds, computing the 64-bit remainder (1e9 * tv_sec)
% interval is annoying; we could break it into (1e9 % interval) *
(tv_sec % interval) but that's still a 30-bit x 63-bit product. We
can break it down further into the high 31 bits and the low 32 bits
of tv_sec but that's getting into a lot of details of multiprecision
arithmetic. And this is good enough for more than the next century.
PR kern/58922: itimer(9): arithmetic overflow
PR kern/58925: itimer(9) responds erratically to clock wound back
PR kern/58926: itimer(9) integer overflow in overrun counting
PR kern/58927: itimer(9): overrun accounting is broken
1.2
01-Apr-2025
riastradh
t_time_arith: Rethink the correct results and add some more cases.
PR kern/58922: itimer(9): arithmetic overflow
PR kern/58925: itimer(9) responds erratically to clock wound back
PR kern/58926: itimer(9) integer overflow in overrun counting
PR kern/58927: itimer(9): overrun accounting is broken
1.1
22-Dec-2024
riastradh
kern: Move some purely arithmetic routines to subr_time_arith.c.
Preparation for testing and fixing:
PR kern/58922: itimer(9): arithmetic overflow
PR kern/58925: itimer(9) responds erratically to clock wound back
PR kern/58926: itimer(9) integer overflow in overrun counting
PR kern/58927: itimer(9): overrun accounting is broken
1.3.4.2
02-Aug-2025
perseant
Sync with HEAD
1.3.4.1
01-Apr-2025
perseant
file subr_time_arith.c was added on branch perseant-exfatfs on 2025-08-02 05:57:42 +0000
Indexes created Sat Sep 20 22:09:52 GMT 2025