Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Sep 2019 13:38:14 -0400
From:      John Baldwin <jhb@FreeBSD.org>
To:        Warner Losh <imp@bsdimp.com>, Philip Paeps <philip@freebsd.org>
Cc:        "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: What value HZ?
Message-ID:  <f2a0fc0b-f051-1137-96b4-61176d9225dd@FreeBSD.org>
In-Reply-To: <CANCZdfqbp%2BU3=0EM2n3bhg4DwXd_PVjvEYjGyQhkE5-MK-3-QA@mail.gmail.com>
References:  <201909060119.x861JWrG006910@repo.freebsd.org> <4917d7507b6ea6c360dccda261f53052aa085f2b.camel@freebsd.org> <5EE266EE-E650-48D8-9B0E-E674AD026470@freebsd.org> <3cb6429acc7e520932d2c906d1cac47540156355.camel@freebsd.org> <8F03EA29-0F3F-4321-9241-78F7C924FDE1@freebsd.org> <CANCZdfr6pz19NCLmsua6iGzusotrcHN=u47RH7Y1PdM4rnomZA@mail.gmail.com> <9BC03B61-F8B5-476C-AD34-9DEA5230BFCF@freebsd.org> <CANCZdfqbp%2BU3=0EM2n3bhg4DwXd_PVjvEYjGyQhkE5-MK-3-QA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f2a0fc0b-f051-1137-96b4-61176d9225dd>