Page MenuHomeFreeBSD

loader: Set twiddle globaldiv to 16 by default
ClosedPublic

Authored by cperciva on Sep 27 2021, 10:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 8:35 AM
Unknown Object (File)
Wed, Apr 10, 4:54 AM
Unknown Object (File)
Mar 11 2024, 6:57 AM
Unknown Object (File)
Mar 11 2024, 6:57 AM
Unknown Object (File)
Mar 11 2024, 6:57 AM
Unknown Object (File)
Mar 7 2024, 10:22 PM
Unknown Object (File)
Jan 5 2024, 5:38 AM
Unknown Object (File)
Jan 5 2024, 1:47 AM

Details

Summary

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.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

stand/defaults/loader.conf, loader(8) and loader_simp(8) all reference this and need to be kept consistent with reality

2nd the documentation updates required, but I agree this change is a good one.

stand/common/console.c
59

Note that the value here doesn't affect loader behaviour since twiddle's globaldiv is only adjusted when twiddle_divisor *changes*; but keeping this up to date results in the right value landing in the kernel environment.

kevans added a subscriber: kevans.

This seems to LGTM.

This revision is now accepted and ready to land.Sep 28 2021, 3:46 AM

Noticed this still in my review queue; landed as 7457840230c5a470ee5df8abed6ab59c4d008a45, but the Differential Revision tag had <> around the URL