]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
init_main: Switch from sysinit array to SLIST
authorColin Percival <cperciva@FreeBSD.org>
Tue, 18 Jul 2023 02:29:20 +0000 (19:29 -0700)
committerColin Percival <cperciva@FreeBSD.org>
Sun, 20 Aug 2023 05:04:56 +0000 (22:04 -0700)
commit9a7add6d01f3c5f7eba811e794cf860d2bce131d
treeefddb214e7d568f4e53742209ef9652a9e60577d
parentcedc82c0466a5116d5a89ecd1f10a69be1a31ca0
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.
2. 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
sys/kern/init_main.c