Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src



Module Name:    src
Committed By:   riastradh
Date:           Sun Oct  5 18:54:02 UTC 2025

Modified Files:
        src/sys/kern: subr_time_arith.c
        src/tests/kernel: t_time_arith.c

Log Message:
tstohz(9): Round up, not down.

This is used for timeouts, and it is bad if it returns a timeout that
is too short, particularly if it rounds `wait a little' to `don't
wait at all'.

This still has some substantial rounding errors, e.g. at hz=8191 with
a period of just over 122 085 ns, tstohz(122 084 ns) this returns 3
when it should return 2 because it rounds up to tvtohz(123 us) for
which 3 is the correct answer -- but at least it's still rounding up.
I'll leave those as xfail for now.

PR kern/59691: tstohz(9) fails to round up on some inputs

This was likely the underlying cause of various heartbeat panics
users have been seeing -- I hypothesize that for short timeouts that
reschedule themselves, the itimer callout would call itself in a loop
and never return from callout_softclock because of this rounding
down:

PR kern/59339: heartbeat watchdog fires since 10.99.14

PR kern/59465: Recurring kernel panic with -current (10.99.14):
"heart stopped beating"

PR kern/59679: Multiple "heart stopped beating" / "softints stuck for
16 seconds" panics


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/kern/subr_time_arith.c
cvs rdiff -u -r1.5 -r1.6 src/tests/kernel/t_time_arith.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index