CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2021/01/13 20:32:01
Modified files:
sys/kern : vfs_sync.c
Log message:
syncer_thread: sleep without lbolt
The syncer_thread() uses lbolt to perform periodic execution. We can
do this without lbolt.
- Adding a local wakeup(9) channel (syncer_chan) and sleep on it.
- Use a local copy of getnsecuptime() to get 1/hz resolution for time
measurements. This is much better than using gettime(9), which is
wholly unsuitable for this use case. Measure how long we spend in
the loop and use this to calculate how long to sleep until the next
execution.
NB: getnsecuptime() is probably ready to be moved to kern_tc.c and
documented.
- Using the system uptime instead of the UTC time avoids issues with
time jumps.
ok mpi@