Skip to content

Global Variables

struct globals (30 fields) source
TODO

almost everything here is RO after init.

I can clone these per-NUMA node and make backpointers via the per-core ‘struct core’ in the G segment register

AKA, split into global and rw_global

§ atomic_bool panicked
§ volatile enum bootstage current_bootstage
§ char *root_partition
§ struct vfs_mount *mount_list_head
TODO

no more list

§ struct vfs_node *root_node
§ struct block_device *root_node_disk
§ struct topology topology
§ size_t numa_node_count
§ struct numa_node *numa_nodes
§ atomic_size_t idle_core_count
§ size_t core_count
§ struct core **cores cc_counted_by(core_count)
§ struct scheduler **schedulers cc_counted_by(core_count)
§ struct dpc_cpu *dpc_data cc_counted_by(core_count)
§ atomic_size_t thread_count
§ size_t domain_count
TODO

We can consider migrating these to per-subsystem locations

§ struct domain **domains cc_counted_by(domain_count)
§ struct domain_buddy *domain_buddies
§ struct page *page_array
§ struct buddy_free_area buddy_free_area[BUDDY_MAX_ORDER]
§ bool scheduler_domains_ready
§ struct scheduler_domain *scheduler_domains[TOPOLOGY_LEVEL_MAX]
§ vaddr_t hhdm_offset
§ atomic_uint64_t pt_epoch
§ uint64_t total_pages
§ pfn_t last_pfn
§ struct movealloc_callback_chain movealloc_chain

Per core workqueues

§ struct workqueue **workqueues cc_counted_by(core_count)
§ struct turnstile_hash_table *turnstiles
§ struct locked_list thread_list
extern struct globals global
source