HomeFreeBSD

init_main: Switch from sysinit array to SLIST

Description

init_main: Switch from sysinit array to SLIST

This has two effects:

  1. We can mergesort the sysinits instead of bubblesorting them, which

shaves about 2 ms off the boot time in Firecracker.

  1. Adding more sysinits (e.g. from a KLD) can be performed by sorting

them and then merging the sorted lists, which is both faster than
the previous "append and sort" approach and avoids needing malloc.

Reviewed by: jhb (previous version)
Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D41075

Details

Provenance
cpercivaAuthored on Jul 18 2023, 2:29 AM
Reviewer
jhb
Differential Revision
D41075: init_main: Switch from sysinit array to SLIST
Parents
rGcedc82c0466a: struct sysinit: Add SLIST_ENTRY(sysinit) next
Branches
Unknown
Tags
Unknown