Merge tag 'xtensa-20180225' of git://github.com/jcmvbkbc/linux-xtensa
[cris-mirror.git] / include / linux / sched / numa_balancing.h
blobe7dd04a84ba89d79507d461cee5b839269ff0b8a
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_SCHED_NUMA_BALANCING_H
3 #define _LINUX_SCHED_NUMA_BALANCING_H
5 /*
6 * This is the interface between the scheduler and the MM that
7 * implements memory access pattern based NUMA-balancing:
8 */
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);
25 #else
26 static inline void task_numa_fault(int last_node, int node, int pages,
27 int flags)
30 static inline pid_t task_numa_group_id(struct task_struct *p)
32 return 0;
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)
43 return true;
45 #endif
47 #endif /* _LINUX_SCHED_NUMA_BALANCING_H */