Page MenuHomeFreeBSD

separate out the non-vnet initialization in a SYSINIT() function
ClosedPublic

Authored by rmacklem on Feb 23 2023, 9:24 PM.
Tags
None
Referenced Files
F87473016: D38749.id118148.diff
Wed, Jul 3, 3:12 PM
Unknown Object (File)
Thu, Jun 13, 2:48 PM
Unknown Object (File)
Tue, Jun 11, 5:52 PM
Unknown Object (File)
May 29 2024, 10:56 PM
Unknown Object (File)
May 29 2024, 9:35 PM
Unknown Object (File)
May 29 2024, 8:28 PM
Unknown Object (File)
May 24 2024, 12:46 AM
Unknown Object (File)
Mar 16 2024, 7:33 PM
Subscribers

Details

Summary

Instead of using IS_DEFAULT_VNET() in the vnet
initialization function, do the prison0 only initialization
in a separate SYSINIT() function.

Test Plan

Tested on a system with nfsd(8) and friends running
both inside prisons and on prison0.
There wre printf's in the initialization functions, to see
that the SYSINIT() one was executed once and the VNET_SYSINIT()
one was executed for all prisons.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Leaving both vnet init and global init as SI_SUB_VNET_DONE, SI_ORDER_ANY doesn't guarantee that the later runs earlier than the former. Although it seems safe today as vnet init doesn't grab the sx(9), imho, better make it correct and establish ordering. The most quick fix would be to set global init to SI_SUB_VNET_DONE, SI_ORDER_FIRST and vnet to SI_SUB_VNET_DONE, SI_ORDER_LAST. A more profound fix would be to think where rpc(9) belongs to in the whole network startup. SI_SUB_VNET_DONE might be too late. I don't know if any other subsystem may call into rpc(9) during boot, just guessing.

This version changes the subsystem for the
SYSINIT/SYSUNINIT macros to SI_SUB_VFS,
which is what is already used for the other
kgssapi SYSINIT.
(This code is a part of the kgssapi.ko module.)

As glebius@ noted, order did not currently
matter, but might matter in the future.

Looks good! P.S. Didn't test.

This revision is now accepted and ready to land.Mar 1 2023, 7:18 PM