From nobody Wed Dec 29 23:06:25 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5C853191FB67; Wed, 29 Dec 2021 23:06:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JPRq54fysz3kKP; Wed, 29 Dec 2021 23:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73B5C5A21; Wed, 29 Dec 2021 23:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BTN6PY0090265; Wed, 29 Dec 2021 23:06:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BTN6PM4090264; Wed, 29 Dec 2021 23:06:25 GMT (envelope-from git) Date: Wed, 29 Dec 2021 23:06:25 GMT Message-Id: <202112292306.1BTN6PM4090264@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 45156a946877 - stable/13 - loader: Set twiddle globaldiv to 16 by default List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 45156a9468772ffd70a6abf12f765db61b33a1b8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640819185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i/izBKodrsMZNKfAEGuCFso/PzvOtDJzX4lbVcDuZzQ=; b=t+PncLfV1/JSej6u5SfGcYqga27DwF1FKamSpMJqFMk96hbKotKmb8MstBHtpl/sMl4hVu 2AHn96AdLkGRCFXYx8rLDUIEI6tdIxDZYdaUQ9pgABaa0SrBumwAqQAgWs87n3NN47RNdS ji33Yp4NhYiyynTFFZSVj1oMWnAAm4jiNQCRMjaLzQcBXjvtWuXHQYirNz8sdDLUxjIFYO noCshyJAKLfoWWnEERZ3wCwVQmA+KxSgFmRHWq/dAi0IxdWxHu6/6M7kElxNQ74Svy01SS vmWph0Z6qzhtccvPds0nJBLmjqTQQJi6AQ2/44K44P6PB9cGGqoYNHdrj5WLdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640819185; a=rsa-sha256; cv=none; b=yWx/v2P9Fq8Vg4p83o1bWw1O4wL+xUSGXo0TSSR1GJPaNHq3buKWbV2wc1i5VTdKW8HweF X2tMQVsCdQQGT/XTgeY+9o4npPPLBxg/o3WmdEmuMAWwfW51P7lXUkmsjalUdM7i2q5DMc +SHleZ/w36Q+6QQuNKZQ75MrvUGoDdjNYZgEZRF60MC75NwqkFadrdaP4c4uehM/w+/TkT OqGuEid6ZmOCNHbzuq2h7jBQo1fm106fMGteKk/3INYZ4OBQ/4i9EXmpCv8rkEW+oA8iVw 1KO3LZ1hlEeFpovRxKydkZFGP04yePYiBoWXF/0qcGKJKxIP5/6rOPAppHKQ1Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=45156a9468772ffd70a6abf12f765db61b33a1b8 commit 45156a9468772ffd70a6abf12f765db61b33a1b8 Author: Colin Percival AuthorDate: 2021-09-28 18:39:59 +0000 Commit: Colin Percival CommitDate: 2021-12-29 22:53:19 +0000 loader: Set twiddle globaldiv to 16 by default Booting FreeBSD on an EC2 c5.xlarge instance, the loader "twiddles" 810 times over the course of 510 ms, a rate of 1.59 kHz. Even accepting that many systems are slower than this particular VM and will take longer to boot (especially if using spinning-rust disks), this seems like an unhelpfully large amount of twiddling when compared to the ~60 Hz frame rate of many displays; printing the twiddles also consumes roughly 10% of the boot time on the aforementioned VM. Setting the default globaldiv to 16 dramatically reduces the time spent printing twiddles to the console while still twiddling at roughly 100 Hz; this should be ample even for systems which take longer to boot and consequently twiddle slower. Note that this can adjusted via the twiddle_divisor variable in loader.conf, but that file is not processed until nearly halfway through the loader's runtime. Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D32163 (cherry picked from commit 7457840230c5a470ee5df8abed6ab59c4d008a45) --- stand/common/console.c | 2 +- stand/defaults/loader.conf | 3 ++- stand/libsa/twiddle.c | 2 +- stand/man/loader.8 | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/stand/common/console.c b/stand/common/console.c index 7886f9386c14..ff864276f96c 100644 --- a/stand/common/console.c +++ b/stand/common/console.c @@ -56,7 +56,7 @@ cons_probe(void) TSENTER(); /* We want a callback to install the new value when this var changes. */ - env_setenv("twiddle_divisor", EV_VOLATILE, "1", twiddle_set, + env_setenv("twiddle_divisor", EV_VOLATILE, "16", twiddle_set, env_nounset); /* Do all console probes */ diff --git a/stand/defaults/loader.conf b/stand/defaults/loader.conf index 7bca621e6703..6feb909d708a 100644 --- a/stand/defaults/loader.conf +++ b/stand/defaults/loader.conf @@ -111,7 +111,8 @@ module_blacklist="drm drm2 radeonkms i915kms amdgpu" # Loader module blacklist #tftp.blksize="1428" # Set the RFC 2348 TFTP block size. # If the TFTP server does not support RFC 2348, # the block size is set to 512. Valid: (8,9007) -#twiddle_divisor="1" # >1 means slow down the progress indicator. +#twiddle_divisor="16" # >16 slows down the progress indicator; + # <16 speeds up the progress indicator. ### Kernel settings ######################################## # The following boot_ variables are enabled by setting them to any value. diff --git a/stand/libsa/twiddle.c b/stand/libsa/twiddle.c index 7565295fa1a3..60022e4c8167 100644 --- a/stand/libsa/twiddle.c +++ b/stand/libsa/twiddle.c @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); /* Extra functions from NetBSD standalone printf.c */ -static u_int globaldiv; +static u_int globaldiv = 16; void twiddle(u_int callerdiv) diff --git a/stand/man/loader.8 b/stand/man/loader.8 index 305c736939fc..71559d945b9b 100644 --- a/stand/man/loader.8 +++ b/stand/man/loader.8 @@ -644,7 +644,8 @@ Throttles the output of the I/O progress indicator displayed while loading the kernel and modules. This is useful on slow serial consoles where the time spent waiting for these characters to be written can add up to many seconds. -The default is 1 (full speed); a value of 2 spins half as fast, and so on. +The default is 16; a value of 32 spins half as fast, +while a value of 8 spins twice as fast. .It Va vm.kmem_size Sets the size of kernel memory (bytes). This overrides the value determined when the kernel was compiled.