Re: git: 4f2465260f03 - main - SYSINIT: add SI_SUB_FIRST
Date: Fri, 21 Aug 2026 13:31:34 UTC
On Tue, 11 Aug 2026, Gleb Smirnoff wrote:
> The branch main has been updated by glebius:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=4f2465260f035fa0095e73b34a74851ef2efaa83
>
> commit 4f2465260f035fa0095e73b34a74851ef2efaa83
> Author: Gleb Smirnoff <glebius@FreeBSD.org>
> AuthorDate: 2026-08-11 14:40:06 +0000
> Commit: Gleb Smirnoff <glebius@FreeBSD.org>
> CommitDate: 2026-08-11 14:40:06 +0000
>
> SYSINIT: add SI_SUB_FIRST
>
> This allows to initialize mp_maxid, mp_ncpus and register APICs at the
> most early stage, guaranteeing that those values will already be available
> at SI_SUB_TUNABLES.
>
> Reviewed by: markj
> Differential Revision: https://reviews.freebsd.org/D58712
> ---
> sys/kern/subr_smp.c | 2 +-
> sys/sys/kernel.h | 1 +
> sys/x86/acpica/madt.c | 2 +-
> sys/x86/x86/local_apic.c | 2 +-
> sys/x86/x86/mptable.c | 3 +--
> 5 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c
> index dd2e829aefbf..a58a179336f3 100644
> --- a/sys/kern/subr_smp.c
> +++ b/sys/kern/subr_smp.c
> @@ -179,7 +179,7 @@ mp_setmaxid(void *dummy)
>
> cpusetsizemin = howmany(mp_maxid + 1, NBBY);
> }
> -SYSINIT(cpu_mp_setmaxid, SI_SUB_TUNABLES, SI_ORDER_FIRST, mp_setmaxid, NULL);
> +SYSINIT(cpu_mp_setmaxid, SI_SUB_FIRST, SI_ORDER_ANY, mp_setmaxid, NULL);
>
> /*
> * Call the MD SMP initialization code.
> diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h
> index 139a570c7ac6..2e1b1bd537cd 100644
> --- a/sys/sys/kernel.h
> +++ b/sys/sys/kernel.h
> @@ -94,6 +94,7 @@ extern volatile long ticksl;
> */
> enum sysinit_sub_id {
> SI_SUB_DUMMY = 0x0000000, /* not executed; for linker */
> + SI_SUB_FIRST = 0x0600000, /* mp_maxid, etc... */
Are we expecting a SI_SUB_PRE_FIRST one day or why did we not put it on 1 but 6?
It seems more likely there'll be something between FIRST and TUNABLE/COPYRIGHT one
day than before FIRST?
> SI_SUB_TUNABLES = 0x0700000, /* establish tunable values */
> SI_SUB_COPYRIGHT = 0x0800001, /* first use of console */
> SI_SUB_VM = 0x1000000, /* virtual memory system init */
--
Bjoern A. Zeeb r15:7