1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_SCHED_NUMA_BALANCING_H
3 #define _LINUX_SCHED_NUMA_BALANCING_H
6 * This is the interface between the scheduler and the MM that
7 * implements memory access pattern based NUMA-balancing:
10 #include <linux/sched.h>
12 #define TNF_MIGRATED 0x01
13 #define TNF_NO_GROUP 0x02
14 #define TNF_SHARED 0x04
15 #define TNF_FAULT_LOCAL 0x08
16 #define TNF_MIGRATE_FAIL 0x10
18 #ifdef CONFIG_NUMA_BALANCING
19 extern void task_numa_fault(int last_node
, int node
, int pages
, int flags
);
20 extern pid_t
task_numa_group_id(struct task_struct
*p
);
21 extern void set_numabalancing_state(bool enabled
);
22 extern void task_numa_free(struct task_struct
*p
);
23 extern bool should_numa_migrate_memory(struct task_struct
*p
, struct page
*page
,
24 int src_nid
, int dst_cpu
);
26 static inline void task_numa_fault(int last_node
, int node
, int pages
,
30 static inline pid_t
task_numa_group_id(struct task_struct
*p
)
34 static inline void set_numabalancing_state(bool enabled
)
37 static inline void task_numa_free(struct task_struct
*p
)
40 static inline bool should_numa_migrate_memory(struct task_struct
*p
,
41 struct page
*page
, int src_nid
, int dst_cpu
)
47 #endif /* _LINUX_SCHED_NUMA_BALANCING_H */