Topology
struct cpu_mask { bool uses_large; union { uint64_t small; uint64_t *large; }; size_t nbits;};struct topology_cache_info { uint8_t level; uint8_t type; uint32_t size_kb; uint32_t line_size; uint32_t cores_sharing;};struct topology_package_info { uint32_t package_id; struct cpu_mask cores;};struct topology_package_info referenced types:
struct topology_node { enum topology_level level; uint64_t id; uint64_t parent; struct topology_node *parent_node; int32_t first_child; int32_t nr_children; struct cpu_mask cpus; struct cpu_mask idle; struct cpu_mask rt_shed_rq_active; struct core *core; union { struct numa_node *numa; struct topology_cache_info *cache; struct topology_package_info *package; } data;};struct topology_node referenced types:
enum topology_levelstruct topology_nodestruct cpu_maskstruct corestruct numa_nodestruct topology_cache_infostruct topology_package_info
struct topology { struct topology_node *level[TOPOLOGY_LEVEL_MAX]; uint16_t count[TOPOLOGY_LEVEL_MAX];};struct topology referenced types:
enum topology_level { TOPOLOGY_LEVEL_SMT, TOPOLOGY_LEVEL_CORE, TOPOLOGY_LEVEL_NUMA, TOPOLOGY_LEVEL_LLC, TOPOLOGY_LEVEL_PACKAGE, TOPOLOGY_LEVEL_MACHINE, TOPOLOGY_LEVEL_MAX, TOPOLOGY_LEVEL_COUNT = TOPOLOGY_LEVEL_MAX,};Defines
Section titled “Defines”#define CPU_MASK_WORD_BITS 64#define CPU_MASK_WORDS(nbits) \ (((nbits) + CPU_MASK_WORD_BITS - 1) / CPU_MASK_WORD_BITS)#define cpu_mask_for_each(iter, mask) \ for (iter = 0; iter < (mask).nbits; ++iter) \ if ((mask).uses_large \ ? atomic_load(&(mask).large[iter / CPU_MASK_WORD_BITS]) & \ (1ULL << (iter % CPU_MASK_WORD_BITS)) \ : atomic_load(&(mask).small) & (1ULL << iter))