numa.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_NUMA_H
  3. #define __ASM_NUMA_H
  4. #include <asm/topology.h>
  5. #ifdef CONFIG_NUMA
  6. #define NR_NODE_MEMBLKS (MAX_NUMNODES * 2)
  7. int __node_distance(int from, int to);
  8. #define node_distance(a, b) __node_distance(a, b)
  9. extern nodemask_t numa_nodes_parsed __initdata;
  10. extern bool numa_off;
  11. /* Mappings between node number and cpus on that node. */
  12. extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
  13. void numa_clear_node(unsigned int cpu);
  14. #ifdef CONFIG_DEBUG_PER_CPU_MAPS
  15. const struct cpumask *cpumask_of_node(int node);
  16. #else
  17. /* Returns a pointer to the cpumask of CPUs on Node 'node'. */
  18. static inline const struct cpumask *cpumask_of_node(int node)
  19. {
  20. if (node == NUMA_NO_NODE)
  21. return cpu_all_mask;
  22. return node_to_cpumask_map[node];
  23. }
  24. #endif
  25. void __init arm64_numa_init(void);
  26. int __init numa_add_memblk(int nodeid, u64 start, u64 end);
  27. void __init numa_set_distance(int from, int to, int distance);
  28. void __init numa_free_distance(void);
  29. void __init early_map_cpu_to_node(unsigned int cpu, int nid);
  30. void numa_store_cpu_info(unsigned int cpu);
  31. void numa_add_cpu(unsigned int cpu);
  32. void numa_remove_cpu(unsigned int cpu);
  33. #else /* CONFIG_NUMA */
  34. static inline void numa_store_cpu_info(unsigned int cpu) { }
  35. static inline void numa_add_cpu(unsigned int cpu) { }
  36. static inline void numa_remove_cpu(unsigned int cpu) { }
  37. static inline void arm64_numa_init(void) { }
  38. static inline void early_map_cpu_to_node(unsigned int cpu, int nid) { }
  39. #endif /* CONFIG_NUMA */
  40. #endif /* __ASM_NUMA_H */