What value HZ?
John Baldwin
jhb at FreeBSD.org
Mon Sep 9 17:38:14 UTC 2019
On 9/6/19 9:46 PM, Warner Losh wrote:
> I'm top posting here, since this thread from a recent commit gives the
> context
>
> I'm proposing basically the following patch:
>
> diff --git a/sys/kern/subr_param.c b/sys/kern/subr_param.c
> index c0025c07eed..bb92afb6449 100644
> --- a/sys/kern/subr_param.c
> +++ b/sys/kern/subr_param.c
> @@ -61,11 +61,7 @@ __FBSDID("$FreeBSD$");
> */
>
> #ifndef HZ
> -# if defined(__mips__) || defined(__arm__) || defined(__riscv)
> -# define HZ 100
> -# else
> -# define HZ 1000
> -# endif
> +# define HZ 1000
> # ifndef HZ_VM
> # define HZ_VM 100
> # endif
>
> Along with removing HZ from almost all the kernel config files in arm and
> mips where it is already 1000. I'm agnostic about riscv, so would also be
> open to just removing the first two clauses from the #if the diff shows me
> removing.
I think this sounds fine. On x86 we use hz=100 instead of 1000 in VMs via
a runtime test. I suspect if anything we might want to take that same factor
into account here. Thus, it makes sense for mips MALTA configs (most often
run under qemu) to use 100, and/or to add a runtime test for qemu that switches
from 1000 to 100. Similarly, for riscv we probably want to use 100 under
qemu and spike, but 1000 on actual hardware via either kernel config options
or runtime checks.
--
John Baldwin
More information about the freebsd-arch
mailing list