Studying how Linux boots up its radix trees...
After some validation it allocates a kmem-cache & hands off to another helper via wrappers altering the type-signature & grabbing locks.
After some additional validation & locks this other helper calls to possibly-update some state while storing some callbacks, propagates any errors or invalid states, & iterates over each CPU core.
For each CPU core it retrieves a per-core pointer & the state within, ...
1/2!
... skips if its less than the caller-given state (in this case DEAD), invokes a helper to retrieve the next "step" for the state if any & call it via the appropriate wrapper, & upon failure triggers (via a helper) appropriate cleanup callbacks.
1.2/1.2 Fin for today! I need to be getting going...
Tomorrow: Housekeeping initialization, & maybe more!