Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _LINUX_SCHED_NUMA_BALANCING_H
0003 #define _LINUX_SCHED_NUMA_BALANCING_H
0004 
0005 /*
0006  * This is the interface between the scheduler and the MM that
0007  * implements memory access pattern based NUMA-balancing:
0008  */
0009 
0010 #include <linux/sched.h>
0011 
0012 #define TNF_MIGRATED    0x01
0013 #define TNF_NO_GROUP    0x02
0014 #define TNF_SHARED  0x04
0015 #define TNF_FAULT_LOCAL 0x08
0016 #define TNF_MIGRATE_FAIL 0x10
0017 
0018 #ifdef CONFIG_NUMA_BALANCING
0019 extern void task_numa_fault(int last_node, int node, int pages, int flags);
0020 extern pid_t task_numa_group_id(struct task_struct *p);
0021 extern void set_numabalancing_state(bool enabled);
0022 extern void task_numa_free(struct task_struct *p, bool final);
0023 extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page,
0024                     int src_nid, int dst_cpu);
0025 #else
0026 static inline void task_numa_fault(int last_node, int node, int pages,
0027                    int flags)
0028 {
0029 }
0030 static inline pid_t task_numa_group_id(struct task_struct *p)
0031 {
0032     return 0;
0033 }
0034 static inline void set_numabalancing_state(bool enabled)
0035 {
0036 }
0037 static inline void task_numa_free(struct task_struct *p, bool final)
0038 {
0039 }
0040 static inline bool should_numa_migrate_memory(struct task_struct *p,
0041                 struct page *page, int src_nid, int dst_cpu)
0042 {
0043     return true;
0044 }
0045 #endif
0046 
0047 #endif /* _LINUX_SCHED_NUMA_BALANCING_H */