From owner-freebsd-arch@freebsd.org Mon Sep 9 23:00:54 2019 Return-Path: Delivered-To: freebsd-arch@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 197FAE4598 for ; Mon, 9 Sep 2019 23:00:54 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46S3YK6V46z4m8p for ; Mon, 9 Sep 2019 23:00:53 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568070052; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=rr6iME9nm0HnaF7OTJmn5YFOKWU784ape/TVzsD0M9zIbgGmFbmbwjj8GbIUktc68bucyBZEOshBg DmTQ/hIKF0ZVqcG+vAQ9I9Y9GlqOHxqShaQBKL9f4gRHeSUJRYTN3o2ze2rVbkI9OmQKM0fmS/wFVY QMBw1r/nJid8w1wHxMmOkalITS3KyFr5RJo/4K9y3emf/fJd5rsEaNwIb0F5yMIXXRgZO4DYvGzWwW HjxY+ui/2r5eOVvmLdKm4gh2mLTyhzk89qqIbPptZlZdUMrzw8XyE2DvuhMRtU/ivGrnp3mBL15WwA Y33B1I+2rSFA5RJ1mPoSL6T+/s6wcdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=Xdg8ziw3SjlS7Nw3ZMBhwLvpu9gI8NlDKewl7EmFGLo=; b=JAdXAC23tpojrVN1j2dFXu7xeMKljaE4C3U78aGPmb3KRNQ75dCDEBcXgCm75gMWKoTsVbvBuo+z/ S2qQn7FeFCNWSqTwWc8ODjJ+Mipjsf+4UpZC2X8ujeIyi8UM1AFk3lqgb9vtskeQWW+207jkiWokx3 y8uZvE5hEx1G10io4/3sE5Vx48EYQzx9vAFXCbdunZYqbIIy7aBo8HcHE9lnVBY+AB0+W53u+ZY317 FGZYtdXEMtmNn82l6Oe7jN+D6xAzZV+GBFJr4ARxbMJ6hFoXmeHDL5V0cDKTrfV6YQmQvh4NMjXPm1 +/BgPMUbSnJnYcrT9TQMRYzYJ5GoZdw== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=Xdg8ziw3SjlS7Nw3ZMBhwLvpu9gI8NlDKewl7EmFGLo=; b=wAWg9ky7PaE7ta6bKyvrxgUwbdna/5WPCi7gbrIH4D4UITd64YSyzFT38Wl9yhgi9ucP28azR8aXg wbEGYOkIrLALqGsxwje2pZqnKFFsUQgAFeR9S+aq40nKmbLrdK0ZsLQX5Q0yQQoOOq+9TSKages5Mu WeIMjD6VqQ3qy2OMG8sjoPKSgjKb5LO37wWN7VC5yud3VKt1H63G8MXZr3z/GvkbGOt7c6KVWJAxjB FumSc7+9G1eDJ1rFf5NQBVkGzbqy8E4ADwTLd302WeypDC5fddFo6S7IliWUmcdRnHhWGiF1v6rsmE RxdjYvIwdQwPx7b56fzwiKHwJP55r0w== X-MHO-RoutePath: aGlwcGll X-MHO-User: aa2f4883-d355-11e9-b67d-cdd75d6ce7a8 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id aa2f4883-d355-11e9-b67d-cdd75d6ce7a8; Mon, 09 Sep 2019 23:00:50 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x89N0nnn064051; Mon, 9 Sep 2019 17:00:49 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <416f023f2dbf08198c75af0873fa112797179be0.camel@freebsd.org> Subject: Re: What value HZ? From: Ian Lepore To: John Baldwin , Warner Losh , Philip Paeps Cc: "freebsd-arch@freebsd.org" Date: Mon, 09 Sep 2019 17:00:48 -0600 In-Reply-To: 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> <9BC03B61-F8B5-476C-AD34-9DEA5230BFCF@freebsd.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46S3YK6V46z4m8p X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-2.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Sep 2019 23:00:54 -0000 On Mon, 2019-09-09 at 13:38 -0400, John Baldwin wrote: > 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. Why? Was this done before or after the advent of event timers and the tickless kernel? If done before, does it still make sense today? > 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. Why? I dunno about MALTA, but for riscv, when I look at the code I see a timer.c that implements one-shot event timers (and actually doesn't support periodic mode event timers at all). The timer.c code is standard, not optional, so one-shot event timers are always available, and the kernel should always run in tickless mode. That being the case, what advantage is there to a lower HZ? -- Ian