CVSROOT:        /cvs
Module name:    src
Changes by:     chel...@cvs.openbsd.org 2019/01/18 18:53:44

Modified files:
        share/man/man9 : microtime.9 
        sys/kern       : init_main.c kern_sysctl.c kern_tc.c 
        sys/nfs        : nfs_serv.c 
        sys/sys        : kernel.h time.h 

Log message:
Move boottime into the timehands.

To protect the timehands we first need to protect the basis for all UTC
time in the kernel: the boottime.

Because the boottime can be changed at any time it needs to be versioned
along with the other members of the timehands to enable safe lockless reads
when using it for anything.  So the global boottime timespec goes away and
the static boottimebin becomes a member of the timehands.  Instead of reading
the global boottime you use one of two interfaces: binboottime(9) or
microboottime(9). nanoboottime(9) can trivially be added later, though there
are no consumers for it at the moment.

This introduces one small change in behavior.  We used to advance the
reported boottime just before launching kernel threads from main().
This makes it look to userland like we "booted" moments before those
threads were launched.  Because there is no longer a boottime global we
can no longer trivially do this from main(), so the boottime we report
to userspace via e.g. kern.boottime will now reflect whatever the time
was when we bootstrapped the timehands via inittodr(9).  This is usually
no more than a minute before the kernel threads are launched from main().
The prior behavior can be restored by adding a new interface to the
timecounter layer in a future commit.

Based on FreeBSD r303387.

Discussed with mpi@ and visa@.

ok visa@

Reply via email to