HomeFreeBSD

init_main: Switch from SLIST to STAILQ, fix order

Description

init_main: Switch from SLIST to STAILQ, fix order

Constructing an SLIST of SYSINITs by inserting them one by one at the
head of the list resulted in them being sorted in anti-stable order:
When two SYSINITs tied for (subsystem, order), they were executed in
the reverse order to the order in which they appeared in the linker
set.

Note that while this changes struct sysinit, it doesn't affect ABI
since SLIST_ENTRY and STAILQ_ENTRY are compatible (in both cases a
single pointer to the next element).

Fixes: 9a7add6d01f3 "init_main: Switch from sysinit array to SLIST"
Reported by: gallatin
Reviewed by: jhb, gallatin, emaste
Approved by: re (gjb)
Tested by: gallatin
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D41748

(cherry picked from commit 71679cf468ba28c0e3c88371f3fde13fccec99bd)
(cherry picked from commit 144db6a1c9fe8bd0bf19aee1d427ad9ceaf292ce)

Details

Provenance
cpercivaAuthored on Sep 5 2023, 11:46 PM
Reviewer
jhb
Differential Revision
D41748: init_main: Switch from SLIST to STAILQ, fix order
Parents
rG80b763d4a539: linux(4): Convert flags in timerfd_create
Branches
Unknown
Tags
Unknown