Changeset View
Changeset View
Standalone View
Standalone View
share/man/man9/hardclock.9
Show All 21 Lines | |||||
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||||
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||||
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||||
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||||
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||||
.\" POSSIBILITY OF SUCH DAMAGE. | .\" POSSIBILITY OF SUCH DAMAGE. | ||||
.\" | .\" | ||||
.Dd March 25, 2010 | .Dd July 1, 2021 | ||||
.Dt HARDCLOCK 9 | .Dt HARDCLOCK 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm hardclock | .Nm hardclock | ||||
.Nd real-time timer | .Nd real-time timer | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.Ft void | .Ft void | ||||
.Fn hardclock "int cnt" "int usermode" | .Fn hardclock "int cnt" "int usermode" | ||||
.Sh DESCRIPTION | .Sh DESCRIPTION | ||||
The | The | ||||
.Fn hardclock | .Fn hardclock | ||||
function is called | function is called periodically based on pending work. | ||||
mav: This is too vague as for me. We could specify that it is called hz times per second when… | |||||
Done Inline Actionshardclock is called adaptively based on pending work. The rate ranges from hz times a second for a very busy system, to as few as twice a second for an idle system. When calls at tick boundaries are omitted, cnt reflects an estimate of the number of elapsed ticks since the last call. Over the long haul, the sum of the cnt argument to this function over a second averages hz, however hz(9) has details important for short time scales. To replace everything in this section down to the usermode argument. imp: hardclock is called adaptively based on pending work. The rate ranges from hz times a second… | |||||
The rate ranges from | |||||
Done Inline Actions"rate"? mav: "rate"? | |||||
Done Inline Actionsyes. Unless there's other changes, though, I'll not push an update to fix it (I've fixed it locally) imp: yes. Unless there's other changes, though, I'll not push an update to fix it (I've fixed it… | |||||
.Va hz | |||||
times per second on a very busy system, to twice a second on an idle system. | |||||
The | |||||
.Va cnt | |||||
argument reports an estimate of the number of ticks since the last call. | |||||
The sum of | |||||
.Va cnt | |||||
over a second averages | |||||
.Va hz | |||||
over the long haul. | |||||
See | |||||
.Xr hz 9 | .Xr hz 9 | ||||
times per second. | for important details over shorter time scales. | ||||
It implements the real-time system clock. | |||||
The argument | The argument | ||||
.Va cnt | |||||
is the estimated number of ticks since the last call to | |||||
.Fn hardclock . | |||||
The argument | |||||
.Va usermode | .Va usermode | ||||
is none-zero when | is none-zero when | ||||
.Fn hardclock | .Fn hardclock | ||||
is called from a user-mode context. | is called from an context that interrupted usermode execution. | ||||
.Pp | .Pp | ||||
.Fn hardclock | .Fn hardclock | ||||
may perform different tasks such as: | may perform different tasks such as: | ||||
.Bl -bullet -offset indent | .Bl -bullet -offset indent | ||||
.It | .It | ||||
Run the current process's virtual and profile time (decrease the | Run the current process's virtual and profile time (decrease the | ||||
corresponding timers, if they are activated, and generate | corresponding timers, if they are activated, and generate | ||||
.Li SIGVTALRM | .Li SIGVTALRM | ||||
Show All 28 Lines | |||||
.Xr epoch 9 | .Xr epoch 9 | ||||
processing. | processing. | ||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr adjtime 2 , | .Xr adjtime 2 , | ||||
.Xr ntp_adjtime 2 , | .Xr ntp_adjtime 2 , | ||||
.Xr signal 3 , | .Xr signal 3 , | ||||
.Xr ntpd 8 , | .Xr ntpd 8 , | ||||
.Xr callout 9 , | |||||
.Xr hz 9 | .Xr hz 9 |
This is too vague as for me. We could specify that it is called hz times per second when system is busy, but at least twice per second when idle.