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
F102070912: D32163.id.diff
Thu, Nov 7, 6:24 AM
Unknown Object (File)
Thu, Oct 24, 5:33 PM
Unknown Object (File)
Thu, Oct 17, 1:21 PM
Unknown Object (File)
Wed, Oct 16, 8:16 PM
Unknown Object (File)
Mon, Oct 14, 5:53 PM
Unknown Object (File)
Sun, Oct 13, 9:37 PM
Unknown Object (File)
Sat, Oct 12, 9:17 AM
Unknown Object (File)
Fri, Oct 11, 1:41 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