| 1 | /* @title: NUMA */ |
| 2 | #include <smp/topology.h> |
| 3 | #include <stdbool.h> |
| 4 | #include <stdint.h> |
| 5 | #pragma once |
| 6 | |
| 7 | struct numa_node { |
| 8 | struct topology_node *topo; |
| 9 | uint64_t mem_base; |
| 10 | uint64_t mem_size; |
| 11 | |
| 12 | uint64_t distances_cnt; |
| 13 | uint8_t *distance; |
| 14 | uint8_t *rel_dists; /* this is an array of node_id -> relative distance. |
| 15 | * the larger the number, the further away the node |
| 16 | * is, relatively speaking. |
| 17 | * |
| 18 | * for example, if we are node 0, and node 3 is the |
| 19 | * 2nd farthest away node, our rel_dists[3] will be 2. |
| 20 | */ |
| 21 | |
| 22 | /* The opposite of rel_dists. Index is the "closeness", value |
| 23 | * is the node at that distance. Basically just zonelists */ |
| 24 | uint8_t *nodes_by_distance; |
| 25 | struct cpu_mask cpus; |
| 26 | }; |
| 27 | |
| 28 | void numa_dump(void); |
| 29 | void numa_construct_relative_distances(struct numa_node *node); |
| 30 | |