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)
Thu, Dec 12, 10:37 PM
Unknown Object (File)
Nov 24 2024, 12:39 PM
Unknown Object (File)
Nov 24 2024, 12:38 PM
Unknown Object (File)
Nov 23 2024, 7:11 AM
Unknown Object (File)
Nov 21 2024, 10:25 AM
Unknown Object (File)
Nov 20 2024, 1:23 PM
Unknown Object (File)
Nov 7 2024, 1:03 PM
Unknown Object (File)
Nov 7 2024, 9:56 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