Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jun 2021 08:18:19 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        Warner Losh <imp@FreeBSD.org>, src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: 4c0bc591466f - main - man9: add hz(9) and hardclock(9)
Message-ID:  <10df4ab6-bee0-58f5-7d42-92850d526e01@FreeBSD.org>
In-Reply-To: <202106181443.15IEhn4t010735@gitrepo.freebsd.org>
References:  <202106181443.15IEhn4t010735@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6/18/21 7:43 AM, Warner Losh wrote:
> The branch main has been updated by imp:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=4c0bc591466fd2731ba892269260b7dab74cfbad
> 
> commit 4c0bc591466fd2731ba892269260b7dab74cfbad
> Author:     Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2021-06-18 14:39:42 +0000
> Commit:     Warner Losh <imp@FreeBSD.org>
> CommitDate: 2021-06-18 14:42:51 +0000
> 
>      man9: add hz(9) and hardclock(9)
>      
>      Document aspects of system time keeping. Hz is the nominal rate that we
>      interrupt the system and is known and the 'tick' period of 1 / hz.
>      hardclock is the routine that does various bits of timekeeping.  stathz
>      and profhz are documented as historical relics that are deprecated
>      and replaced by hwpmc.4 and others.
>      
>      Reviewed by:            phk@, mav@ and gnn@ (previous version)
>      Obtained from:          hardclock.9 from NetBSD (with FreeBSD adjustments)
>      Sponsored by:           Netflix
>      Differential Revision:  https://reviews.freebsd.org/D30802

The comments about stathz are wrong.  While profhz is obsolete and replaced by
hwpmc, statclock is not.  statclock is used to implement getrusage(), %CPU in
ps(1), and kern.cp_time (global and per-CPU stats for CPU usage breakdown you
see in top(1) for example).  hwpmc doesn't replace any of those.  OTOH, it's
also true that there's no real reason for anything outside of the actual timer
code to use stathz (or even profhz) unlike 'hz' which is still used to set
timeout tick values.

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?10df4ab6-bee0-58f5-7d42-92850d526e01>