Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/smp.h
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | struct topo_node { | ||||
cpuset_t cpuset; | cpuset_t cpuset; | ||||
topo_node_type type; | topo_node_type type; | ||||
uintptr_t subtype; | uintptr_t subtype; | ||||
hwid_t hwid; | hwid_t hwid; | ||||
cpuid_t id; | cpuid_t id; | ||||
int nchildren; | int nchildren; | ||||
int cpu_count; | int cpu_count; | ||||
}; | }; | ||||
#define TOPO_NODE_INITIALIZER(node) \ | |||||
{ \ | |||||
.children = TAILQ_HEAD_INITIALIZER((node).children), \ | |||||
.type = TOPO_TYPE_SYSTEM, \ | |||||
} | |||||
/* | /* | ||||
* Scheduling topology of a NUMA or SMP system. | * Scheduling topology of a NUMA or SMP system. | ||||
* | * | ||||
* The top level topology is an array of pointers to groups. Each group | * The top level topology is an array of pointers to groups. Each group | ||||
* contains a bitmask of cpus in its group or subgroups. It may also | * contains a bitmask of cpus in its group or subgroups. It may also | ||||
* contain a pointer to an array of child groups. | * contain a pointer to an array of child groups. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | enum topo_level { | ||||
TOPO_LEVEL_CACHEGROUP, | TOPO_LEVEL_CACHEGROUP, | ||||
TOPO_LEVEL_CORE, | TOPO_LEVEL_CORE, | ||||
TOPO_LEVEL_THREAD, | TOPO_LEVEL_THREAD, | ||||
TOPO_LEVEL_COUNT /* Must be last */ | TOPO_LEVEL_COUNT /* Must be last */ | ||||
}; | }; | ||||
struct topo_analysis { | struct topo_analysis { | ||||
int entities[TOPO_LEVEL_COUNT]; | int entities[TOPO_LEVEL_COUNT]; | ||||
}; | }; | ||||
extern int cpu_topo_probed; | |||||
extern struct topo_node topo_root; | |||||
int topo_analyze(struct topo_node *topo_root, int all, | int topo_analyze(struct topo_node *topo_root, int all, | ||||
struct topo_analysis *results); | struct topo_analysis *results); | ||||
#define TOPO_FOREACH(i, root) \ | #define TOPO_FOREACH(i, root) \ | ||||
for (i = root; i != NULL; i = topo_next_node(root, i)) | for (i = root; i != NULL; i = topo_next_node(root, i)) | ||||
struct cpu_group *smp_topo(void); | struct cpu_group *smp_topo(void); | ||||
struct cpu_group *smp_topo_alloc(u_int count); | struct cpu_group *smp_topo_alloc(u_int count); | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |