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