Next up Linux initializes its "pagesets" datastructure.
Primarily this involves iterating over (via a macro) the available "zones" flagged as populated, invoking a helper for each.
After allocating 1 or 2 per-core pointers it iterates over available cores retrieving its pointers into these to hand over to another helper in turn which clears data while initializing a lock & some linkedlists. After iterating over the cores another suite of helpers populates various globals.
1/2?
Much of the process boils down to reformatting bitmasks, & there's atomic involved. Not that I'm really on what much of this is for.
If NUMA's compiletime-enabled the toplevel "pagesets" initializer iterates over cores zeroing out some of their data. And regardless it then iterates over the "pgdats" to allocate more per-core pointers.
1.5/1.5 Fin for today! Tomorrow: NUMA policy, & possibly more!