Because recalculate is only called once or twice for long sleeps,
authorMatthew Dillon <dillon@dragonflybsd.org>
Tue, 27 Sep 2005 18:03:32 +0000 (18:03 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Tue, 27 Sep 2005 18:03:32 +0000 (18:03 +0000)
commit6988c2ae59051364e5b737b24eb866427cd01c55
tree414dcf55561fa62b48135600ad786ad547c8b0f4
parent1b6f9882a9e601f573a8a7a49c443643012a9572
Because recalculate is only called once or twice for long sleeps,
not every second forever while the process is sleeping, we have
to manually call it to resynchronize p_cpbase on wakeup or it
will wrap if the process was sleeping long enough (e.g. ~10 min
with the ACPI timer) and really mess up the nticks calculation.

The bug could very rarely result in an integer divide by 0 crash.

Reported-by: David Rhodus
sys/kern/usched_bsd4.c