CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2019/07/03 16:39:33
Modified files:
share/man/man9 : tsleep.9
sys/kern : kern_acct.c kern_smr.c kern_synch.c
sys/sys : systm.h time.h
sys/uvm : uvm_pdaemon.c uvm_pmemrange.c
Log message:
Add tsleep_nsec(9), msleep_nsec(9), and rwsleep_nsec(9).
Equivalent to their unsuffixed counterparts except that (a) they take
a timeout in terms of nanoseconds, and (b) INFSLP, aka UINT64_MAX (not
zero) indicates that a timeout should not be set.
For now, zero nanoseconds is not a strictly valid invocation: we log a
warning on DIAGNOSTIC kernels if we see such a call. We still sleep
until the next tick in such a case, however. In the future this could
become some sort of poll... TBD.
To facilitate conversions to these interfaces: add inline conversion
functions to sys/time.h for turning your timeout into nanoseconds.
Also do a few easy conversions for warmup and to demonstrate how
further conversions should be done.
Lots of input from mpi@ and ratchov@. Additional input from tedu@,
deraadt@, mortimer@, millert@, and claudio@.
Partly inspired by FreeBSD r247787.
positive feedback from deraadt@, ok mpi@