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. Reviewed by: allanjude, jrtc27, kevans MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva Differential Revision: <https://reviews.freebsd.org/D32163>
This commit is contained in:
parent
667ea7385d
commit
7457840230
@ -56,7 +56,7 @@ cons_probe(void)
|
|||||||
TSENTER();
|
TSENTER();
|
||||||
|
|
||||||
/* We want a callback to install the new value when this var changes. */
|
/* 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);
|
env_nounset);
|
||||||
|
|
||||||
/* Do all console probes */
|
/* Do all console probes */
|
||||||
|
@ -111,7 +111,8 @@ module_blacklist="drm drm2 radeonkms i915kms amdgpu" # Loader module blacklist
|
|||||||
#tftp.blksize="1428" # Set the RFC 2348 TFTP block size.
|
#tftp.blksize="1428" # Set the RFC 2348 TFTP block size.
|
||||||
# If the TFTP server does not support RFC 2348,
|
# If the TFTP server does not support RFC 2348,
|
||||||
# the block size is set to 512. Valid: (8,9007)
|
# 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 ########################################
|
### Kernel settings ########################################
|
||||||
# The following boot_ variables are enabled by setting them to any value.
|
# The following boot_ variables are enabled by setting them to any value.
|
||||||
|
@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
/* Extra functions from NetBSD standalone printf.c */
|
/* Extra functions from NetBSD standalone printf.c */
|
||||||
|
|
||||||
static u_int globaldiv;
|
static u_int globaldiv = 16;
|
||||||
|
|
||||||
void
|
void
|
||||||
twiddle(u_int callerdiv)
|
twiddle(u_int callerdiv)
|
||||||
|
@ -644,7 +644,8 @@ Throttles the output of the
|
|||||||
I/O progress indicator displayed while loading the kernel and modules.
|
I/O progress indicator displayed while loading the kernel and modules.
|
||||||
This is useful on slow serial consoles where the time spent waiting for
|
This is useful on slow serial consoles where the time spent waiting for
|
||||||
these characters to be written can add up to many seconds.
|
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
|
.It Va vm.kmem_size
|
||||||
Sets the size of kernel memory (bytes).
|
Sets the size of kernel memory (bytes).
|
||||||
This overrides the value determined when the kernel was compiled.
|
This overrides the value determined when the kernel was compiled.
|
||||||
|
@ -624,7 +624,8 @@ Throttles the output of the
|
|||||||
I/O progress indicator displayed while loading the kernel and modules.
|
I/O progress indicator displayed while loading the kernel and modules.
|
||||||
This is useful on slow serial consoles where the time spent waiting for
|
This is useful on slow serial consoles where the time spent waiting for
|
||||||
these characters to be written can add up to many seconds.
|
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
|
.It Va vm.kmem_size
|
||||||
Sets the size of kernel memory (bytes).
|
Sets the size of kernel memory (bytes).
|
||||||
This overrides the value determined when the kernel was compiled.
|
This overrides the value determined when the kernel was compiled.
|
||||||
|
Loading…
Reference in New Issue
Block a user