From owner-freebsd-arch@freebsd.org Sun Sep 8 01:58:27 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 EB619E4A93 for ; Sun, 8 Sep 2019 01:58:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io1-f68.google.com (mail-io1-f68.google.com [209.85.166.68]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46Qvb66gzyz4M96; Sun, 8 Sep 2019 01:58:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io1-f68.google.com with SMTP id b136so21279780iof.3; Sat, 07 Sep 2019 18:58:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=OmvcQyOr/c+GKoK6B11tCrgpCxwvGwE/A59ufYaisYo=; b=fxcbr8jHqrymMZsaYLoOMUx5iWSUvQKRkZ+bEv1u2ti3Li3fu03qvKvB4PY36dGkNK 9I1qxAz+jo63dlDm0cQfpAjVguZKtn2OFzUrl0lKQ26++1MD6bZmxgT/eCzSN2sscCoR QWISmC2oj87MXfTF6K66KOZ63juL1WMmItM5n1BoHMM5n/0NjJfCf13zAgLMOiO2+Tlz IuEwIqEfpNjjxBqf5aA1qJj/GQHzTaEmBvxOBwpDC/usXQFbd9OVjGQpnS6RNKObucos ZgWkRbx6mrmWxTOoqp6uPZf/oI6B6uonDYGIVkEszliW7EZ9gV4qoAIEHstHEvntyuq0 Pc2Q== X-Gm-Message-State: APjAAAV1QSrcw31n94F65g19lS7qF+8HaPLsDLGFQD/8ou9JfSBwvLoH LPCcz1NRZEltxRw+jJ3cDtCYRG5y X-Google-Smtp-Source: APXvYqwllMyfTQLWtUCdNqVS6HLamaguutEjSz8ygOyib95ErhdS6kWU+QqiB6JtRkFS3WYY5Iwkrg== X-Received: by 2002:a02:a516:: with SMTP id e22mr18346909jam.77.1567907905078; Sat, 07 Sep 2019 18:58:25 -0700 (PDT) Received: from mail-io1-f41.google.com (mail-io1-f41.google.com. [209.85.166.41]) by smtp.gmail.com with ESMTPSA id z20sm10062742iof.38.2019.09.07.18.58.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Sep 2019 18:58:24 -0700 (PDT) Received: by mail-io1-f41.google.com with SMTP id r4so21242838iop.4; Sat, 07 Sep 2019 18:58:24 -0700 (PDT) X-Received: by 2002:a02:cb51:: with SMTP id k17mr17624889jap.119.1567907904477; Sat, 07 Sep 2019 18:58:24 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 7 Sep 2019 18:58:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: What value HZ? To: "Constantine A. Murenin" Cc: "freebsd-arch@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 46Qvb66gzyz4M96 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.166.68 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-3.65 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[cem@freebsd.org]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; RCPT_COUNT_TWO(0.00)[2]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; SUBJECT_ENDS_QUESTION(1.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; MIME_TRACE(0.00)[0:+]; RCVD_IN_DNSWL_NONE(0.00)[68.166.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.66)[ip: (-2.68), ipnet: 209.85.128.0/17(-3.32), asn: 15169(-2.27), country: US(-0.05)]; RWL_MAILSPIKE_POSSIBLE(0.00)[68.166.85.209.rep.mailspike.net : 127.0.0.17]; RCVD_TLS_ALL(0.00)[] 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: Sun, 08 Sep 2019 01:58:28 -0000 Hi Constantine, On Sat, Sep 7, 2019 at 3:05 PM Constantine A. Murenin wrote: > > For the sake of discussion, I recall that there was a measurable power > consumption difference between FreeBSD (HZ=3D1000) and OpenBSD (HZ=3D100)= when > I played with a Kill-A-Watt a number of years ago. Unfortunately, this is an apples to oranges comparison, and perhaps worse, vague and dated. It would be more interesting to compare HZ=3D1000 to HZ=3D100 with an otherwise identical CURRENT FreeBSD system. As far as I can tell, FreeBSD grew "tickless" timer support in r212541 in 2010 (thanks mav@). This is easily observed on my idle HZ=3D1000 amd64 system with 'vmstat -i': "cpu0:timer" is firing at an average rate of 21 Hz =E2=80=94 not 1000. And that is the most frequent interrupt. > Would it perhaps be prudent to try to qualify whether, and by how much, > this change affects power consumption on MIPS/ARM/RISCV, not just whether > each arch could cope with the change? If someone has the time and inclination, then of course, it could be an interesting test to run. Best, Conrad From owner-freebsd-arch@freebsd.org Mon Sep 9 13:07:16 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 15FF2D1DFE for ; Mon, 9 Sep 2019 13:07:16 +0000 (UTC) (envelope-from Replay@dirtydogsscrubgrubandmeow.net) Received: from dirtydogsscrubgrubandmeow.net (li1362-176.members.linode.com [139.162.199.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46RpNL3sqCz3y7f for ; Mon, 9 Sep 2019 13:07:14 +0000 (UTC) (envelope-from Replay@dirtydogsscrubgrubandmeow.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dirtydogsscrubgrubandmeow.net; s=default; h=Content-Type:List-Unsubscribe: Message-ID:Sender:From:Date:MIME-Version:Subject:To:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Subscribe:List-Post:List-Owner:List-Archive ; bh=YEDgGPrXPinNtmgJrJmCjNXgrzKRhnDusLH52J9X8yo=; b=OMmdzOBmND+aY/mTJQAcwPDY vvFVrU7jqtEZhZ5PeMeFGQmNNWXc9FlJ1qrqpPoTVFVnlcLkkbGsGsn3RsyB9fuNt0f5fb4vT1NGC 6uBwKvLrlFmB81P8YB+Eusuof196o2Dn8vsdRU78nlYJwsI+2LJ1UqHG8ge65EjxDjORIQ=; To: freebsd-arch@freebsd.org Subject: =?UTF-8?Q?=E2=9C=92=EF=B8=8F_Why_you_answer_so_long_for_my_message=3F?= MIME-Version: 1.0 Date: Mon, 9 Sep 2019 13:07:05 +0000 From: =?UTF-8?B?0J3QvtGB0LrQvtCy0LAg0JzQsNGA0YLQsA==?= Sender: Replay@dirtydogsscrubgrubandmeow.net Message-ID: <19433935252.472246@dirtydogsscrubgrubandmeow.net> X-Priority: 3 X-Rspamd-Queue-Id: 46RpNL3sqCz3y7f X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=pass header.d=dirtydogsscrubgrubandmeow.net header.s=default header.b=OMmdzOBm; dmarc=pass (policy=none) header.from=dirtydogsscrubgrubandmeow.net; spf=pass (mx1.freebsd.org: domain of Replay@dirtydogsscrubgrubandmeow.net designates 139.162.199.176 as permitted sender) smtp.mailfrom=Replay@dirtydogsscrubgrubandmeow.net X-Spamd-Result: default: False [0.17 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.16)[-0.158,0]; R_DKIM_ALLOW(-0.20)[dirtydogsscrubgrubandmeow.net:s=default]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; NEURAL_HAM_LONG(-0.57)[-0.567,0]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.80)[ipnet: 139.162.192.0/19(4.93), asn: 63949(-0.87), country: US(-0.05)]; DKIM_TRACE(0.00)[dirtydogsscrubgrubandmeow.net:+]; MIME_BASE64_TEXT(0.10)[]; HAS_X_PRIO_THREE(0.00)[3]; DMARC_POLICY_ALLOW(-0.50)[dirtydogsscrubgrubandmeow.net,none]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:63949, ipnet:139.162.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 13:07:16 -0000 U3VwLG15IGJpZ2JveS4gaSB3YXMgc2VlbiB5b3UgIGZyb20gWHZpZGllb3MgbGFzdCB3ZWVrIGFu ZCBzbyBJIHdvdWxkIGxpa2UgdG8gZnVjYyB5b3UuDQpNeSBuYW1lIHtNYXJ5fEFkZWxpYXxNYXJn YXJldHxEb3JvdGh5fEthdGhlcmluZXxEb25uYXxNYXJpb258UHJpbXJvc2XRg3xSdWJ50YN8Q2hy aXN0aWFuYXxOb3JtYXxJbGVuZXxDb3JhbHxCcmlhbm5hfExvdWlzZdGDfEphbmV8UmFjaGVs0Yd8 RWxpemFiZXRofEp1bGlh0YN8RW1pbHl8Q2xlbWVudGluZXxDYXJvbHxBbWljZXxDbGFyaXNzYXxH cmFjZXxHYWJyaWVsbGF8Um9zYW5uYXxHcmFjZXxDYXJvbHxDYW5kaWNlfExpc2F8TWFyeXxKdWxp ZXTRg3xDYXJvbHxKYW5lfE9saXZpYXxHcmFjZXxFc3RlbGxhfE1lcmlseW58TWFkZWxlaW5lfEpv YW5uYXxEZWlyZHJlfE1hcmxlbmV8QW1iZXJ8TWFyeXxSZWJlY2NhfExvcmF8U2hhcm9ufEFsZXhh bmRyaW5hfElyZW5lfFBhdGllbmNlfExpbHl8TWVsYW5pZXxDb3JuZWxpYXxNYXJpbHlubnxNYXJ5 fENhcm1lbHxDYXJvbGluZXxBbm58UmViZWNjYXxKYW5lfEpvZHl8R3JQYXRyaWNpYQ0KSSBkbyBz b21lIEFjY291bnQgd2l0aCBteSBubmtlZCBwaG90b3MuDQpJIHdpbGwgV2FpdCB5b3V0aCBtZXNz YWdlcy4NCk15IG5pY2sgOiBSb2JpbnNvbjUzOC4NCg0KUGxlYWFzZSBGaW5kIG1lIHRoZXJlIQ== From owner-freebsd-arch@freebsd.org Mon Sep 9 17:38:14 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 B27B6D989E for ; Mon, 9 Sep 2019 17:38:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46RwP24M85z4HyG; Mon, 9 Sep 2019 17:38:14 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (unknown [IPv6:2601:648:8880:1e30:c42c:770f:27f8:4624]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id E0839B3F9; Mon, 9 Sep 2019 17:38:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: What value HZ? To: Warner Losh , Philip Paeps Cc: "freebsd-arch@freebsd.org" 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> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 9 Sep 2019 13:38:14 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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 17:38:14 -0000 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 From owner-freebsd-arch@freebsd.org Mon Sep 9 22:53:20 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 6DDC5E427E for ; Mon, 9 Sep 2019 22:53:20 +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 46S3Nc1jGxz4lpN for ; Mon, 9 Sep 2019 22:53:19 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1568069599; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=ZIjL4T8YP9vGoYs7pAUM2+7U7CKDo309aOzLHNa6mWPpVsMSa5oH1um/if5HpSjlVxYkutjtbYjvC 1k137l5wmTVjeqhDPSmIGt8X0xQAzt8Z9DHtwQN36dFL2bPiVlDcEWX2gzZX6Q+m5g0nYX4LQXT68N 7V96xCHuqaFT2Vb27XRY14OfoiLS06IzdU9PiSGpn/ylGaJNcrRfpf+ueYcld9djOpOEcICoCRNbUg K63bvd1sqk2K25LAM6mugXNkJQCR8upCYpTAhiOPKlDIP/kNngeDTdfLsxu9zPXbVGV8WQMvUgRkfG ZEKg75VUcQMD8QQOSB91x+/XVwUKHRQ== 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=LKfOE6E4p5S0XtwaQgo4zi4uLaYTl6BPdTdialp2I24=; b=XutNN9Qc3luCZbGixxGu1PkwQ211vTCdDekMRh+36EGY16IqGx/u5XXB140p5+SfwvA5cTTDdRZme YNQawZagdMv+e1WbaUBsHHuVjnqSNdH3imKKopl/6wZ7bcSmFUpuLalKXiKQQIHFSn/m49DKxW1URq vJLym+F2FoJy29//CjYbwE3DOj3oiUmdTAfDu/Wbw+5oTbH6/ZUy5Y+ozh6i8Gb6VV0QHI8VZwWZpM aHRlmqGXiZXn9uBg/M6nBvihu9YQ4GaWJoGHDUU3kVgok9QEt+lChOhedAQBTRr9xP9+PrhzXn/SUQ Yp4ziNyy7PmYNq3knDxUl4Uz7VBIMVw== 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=LKfOE6E4p5S0XtwaQgo4zi4uLaYTl6BPdTdialp2I24=; b=IRDzeE95aAyS6PDvCHTL7pzLIzuSa7bhtgKrJFVh+mjss+sNY3Pt89Yv2QrIj90ek/HKgaKGuO5Fe xnENUO2gnM9b/Hc3crF6/wYO2qKzMLSiInehepE0yxbwx1DajHjUVHa01xx1GBpHPhUYaat1bomBGh IsW8S/35GF8bjx/h+f/k9ayA0TimRo5y/ksYTVydmXOB6V+08vnoU5LSRPezbuncOgyz0zK+oeeIs0 Qo4zrHiDsxtBFWIdvIC1SOJ99P9admabSvlm/2eS/H1T5ctPbb8Er3QDJD1wCMcaZ7kH4f1mBpWvOD t0dO470bWEkgT2m5um8CogySS+yMwtw== X-MHO-RoutePath: aGlwcGll X-MHO-User: 9c6827ac-d354-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 9c6827ac-d354-11e9-b67d-cdd75d6ce7a8; Mon, 09 Sep 2019 22:53:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id x89MrG7o064009; Mon, 9 Sep 2019 16:53:16 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <16539c09c4b65c2f5d239e78d88e9d9985ba588b.camel@freebsd.org> Subject: Re: What value HZ? From: Ian Lepore To: cem@freebsd.org Cc: "freebsd-arch@freebsd.org" Date: Mon, 09 Sep 2019 16:53:16 -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: 8bit X-Rspamd-Queue-Id: 46S3Nc1jGxz4lpN 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 22:53:20 -0000 On Sat, 2019-09-07 at 18:58 -0700, Conrad Meyer wrote: > Hi Constantine, > > On Sat, Sep 7, 2019 at 3:05 PM Constantine A. Murenin > wrote: > > > > For the sake of discussion, I recall that there was a measurable power > > consumption difference between FreeBSD (HZ=1000) and OpenBSD (HZ=100) when > > I played with a Kill-A-Watt a number of years ago. > > Unfortunately, this is an apples to oranges comparison, and perhaps > worse, vague and dated. It would be more interesting to compare > HZ=1000 to HZ=100 with an otherwise identical CURRENT FreeBSD system. > > As far as I can tell, FreeBSD grew "tickless" timer support in r212541 > in 2010 (thanks mav@). This is easily observed on my idle HZ=1000 > amd64 system with 'vmstat -i': "cpu0:timer" is firing at an average > rate of 21 Hz — not 1000. And that is the most frequent interrupt. > > > Would it perhaps be prudent to try to qualify whether, and by how much, > > this change affects power consumption on MIPS/ARM/RISCV, not just whether > > each arch could cope with the change? > > If someone has the time and inclination, then of course, it could be > an interesting test to run. In this mail, when I say HZ, I mean also 'hz' the global var that's tunable... When I saw this conversation moved to arch@ my first thought was "Good, we can finally have the conversation I've been trying to have with people for years." But, alas, the focus even here is still just "100 vs 1000", not the base question I really want to see answered. I'm replying to this message in the thread because it comes closest to touching on that base question, which is: What, exactly, does HZ control and affect these days? It no longer controls how often periodic timer interrupts happen, except on a few rare systems that don't support one-shot style event timers. I'm not sure any such systems even still exist, now that we've nuked most of the old armv4 support. If they do exist, I'm pretty sure it's only in the MIPS arch. It no longer controls the scheduling quantum for a process or thread. Or so I've been told, I'm pretty ignorant about the workings of both schedulers. It no longer controls the minimum amount of time a userland process can sleep when calling the usleep() or nanosleep() functions. The one thing I know for sure that HZ affects is whatever code still exists that schedules timeouts in terms of 'ticks' rather than using the newer SBT flavor of sleeping functions. Old-school pause(9) and msleep(9) and others that take a timeout in 'ticks' will have the timeout granularity implied by HZ, and there is still such code around in various device drivers and other places. Aside from old-school tick-based sleep functions, does HZ do anything anymore? -- Ian 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 From owner-freebsd-arch@freebsd.org Fri Sep 13 19:52:53 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 BEBD1D1545 for ; Fri, 13 Sep 2019 19:52:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 46VRBY4h4Qz43N9 for ; Fri, 13 Sep 2019 19:52:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id A0BC8D1544; Fri, 13 Sep 2019 19:52:53 +0000 (UTC) Delivered-To: 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 A0862D1543 for ; Fri, 13 Sep 2019 19:52:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46VRBY3mxyz43N8 for ; Fri, 13 Sep 2019 19:52:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5952BF758 for ; Fri, 13 Sep 2019 19:52:53 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f179.google.com with SMTP id j31so8515278qta.5 for ; Fri, 13 Sep 2019 12:52:53 -0700 (PDT) X-Gm-Message-State: APjAAAWJkeHXCldMLf478R+cQe3bDaWC4day/Kzbw41gcBXQtWOzHY2H glkQ4BpjCJG4Y3KiQVx7idWL6QH9DS+yEBzoZBk= X-Google-Smtp-Source: APXvYqyzi2ZqaqBMTTTGcFDR6De+jmdYuiIBwBW47GuI5gYsbSxmbSUClJr/FjpESorS8VspSvK6nsO3amfOlUkq9yI= X-Received: by 2002:ac8:2bca:: with SMTP id n10mr5116764qtn.242.1568404372711; Fri, 13 Sep 2019 12:52:52 -0700 (PDT) MIME-Version: 1.0 From: Kyle Evans Date: Fri, 13 Sep 2019 14:52:40 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: PicoBSD Build Scripts To: "freebsd-arch@freebsd.org" Content-Type: text/plain; charset="UTF-8" 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: Fri, 13 Sep 2019 19:52:53 -0000 Hi, A PR[0] has recently surfaced pertaining to the PicoBSD build scripts (see: picobsd(8), ^/release/picobsd) and how they fail to produce usable output by default. Some further investigation revealed that the build script is actually pretty broken, and has to have been for at least a couple of years... see comment #2 on the referenced PR. Because of this and that it hasn't seen much active maintenance (mostly drive-by mechanical changes, from what I can tell) for years, I'd like to propose deprecation and removal of the PicoBSD build scripts. The bits at ^/release/picobsd/tinyware can likely be moved to the ^/tools hierarchy, as they might be independently useful. Specifically, I propose a soft deadline of October 31st for removal; if someone comes forward with patches or an interest in working on it, nothing will be removed at this time. I further propose a hard deadline of December 31st for removal without patches posted to address the various issue. I'll happily review any patches that come across my virtual desk. Thoughts/comments/concerns? Thanks, Kyle Evans [0] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=240506