Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
6a3827d7 IM |
2 | #ifndef _LINUX_SCHED_NUMA_BALANCING_H |
3 | #define _LINUX_SCHED_NUMA_BALANCING_H | |
4 | ||
5647028d IM |
5 | /* |
6 | * This is the interface between the scheduler and the MM that | |
7 | * implements memory access pattern based NUMA-balancing: | |
8 | */ | |
9 | ||
6a3827d7 IM |
10 | #include <linux/sched.h> |
11 | ||
5647028d IM |
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 | |
17 | ||
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); | |
16d51a59 | 22 | extern void task_numa_free(struct task_struct *p, bool final); |
5647028d IM |
23 | extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page, |
24 | int src_nid, int dst_cpu); | |
25 | #else | |
26 | static inline void task_numa_fault(int last_node, int node, int pages, | |
27 | int flags) | |
28 | { | |
29 | } | |
30 | static inline pid_t task_numa_group_id(struct task_struct *p) | |
31 | { | |
32 | return 0; | |
33 | } | |
34 | static inline void set_numabalancing_state(bool enabled) | |
35 | { | |
36 | } | |
16d51a59 | 37 | static inline void task_numa_free(struct task_struct *p, bool final) |
5647028d IM |
38 | { |
39 | } | |
40 | static inline bool should_numa_migrate_memory(struct task_struct *p, | |
41 | struct page *page, int src_nid, int dst_cpu) | |
42 | { | |
43 | return true; | |
44 | } | |
45 | #endif | |
46 | ||
6a3827d7 | 47 | #endif /* _LINUX_SCHED_NUMA_BALANCING_H */ |