numa_balancing.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _LINUX_SCHED_NUMA_BALANCING_H
  3. #define _LINUX_SCHED_NUMA_BALANCING_H
  4. /*
  5. * This is the interface between the scheduler and the MM that
  6. * implements memory access pattern based NUMA-balancing:
  7. */
  8. #include <linux/sched.h>
  9. #define TNF_MIGRATED 0x01
  10. #define TNF_NO_GROUP 0x02
  11. #define TNF_SHARED 0x04
  12. #define TNF_FAULT_LOCAL 0x08
  13. #define TNF_MIGRATE_FAIL 0x10
  14. #ifdef CONFIG_NUMA_BALANCING
  15. extern void task_numa_fault(int last_node, int node, int pages, int flags);
  16. extern pid_t task_numa_group_id(struct task_struct *p);
  17. extern void set_numabalancing_state(bool enabled);
  18. extern void task_numa_free(struct task_struct *p, bool final);
  19. extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page,
  20. int src_nid, int dst_cpu);
  21. #else
  22. static inline void task_numa_fault(int last_node, int node, int pages,
  23. int flags)
  24. {
  25. }
  26. static inline pid_t task_numa_group_id(struct task_struct *p)
  27. {
  28. return 0;
  29. }
  30. static inline void set_numabalancing_state(bool enabled)
  31. {
  32. }
  33. static inline void task_numa_free(struct task_struct *p, bool final)
  34. {
  35. }
  36. static inline bool should_numa_migrate_memory(struct task_struct *p,
  37. struct page *page, int src_nid, int dst_cpu)
  38. {
  39. return true;
  40. }
  41. #endif
  42. #endif /* _LINUX_SCHED_NUMA_BALANCING_H */