hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/oom.h
....@@ -15,6 +15,13 @@
1515 struct mem_cgroup;
1616 struct task_struct;
1717
18
+enum oom_constraint {
19
+ CONSTRAINT_NONE,
20
+ CONSTRAINT_CPUSET,
21
+ CONSTRAINT_MEMORY_POLICY,
22
+ CONSTRAINT_MEMCG,
23
+};
24
+
1825 /*
1926 * Details of the page allocation that triggered the oom killer that are used to
2027 * determine what should be killed.
....@@ -41,7 +48,12 @@
4148 /* Used by oom implementation, do not set */
4249 unsigned long totalpages;
4350 struct task_struct *chosen;
44
- unsigned long chosen_points;
51
+ long chosen_points;
52
+ struct task_struct *chosen_non_negative_adj;
53
+ long chosen_non_negative_adj_points;
54
+
55
+ /* Used to print the constraint info. */
56
+ enum oom_constraint constraint;
4557 };
4658
4759 extern struct mutex oom_lock;
....@@ -98,8 +110,7 @@
98110
99111 bool __oom_reap_task_mm(struct mm_struct *mm);
100112
101
-extern unsigned long oom_badness(struct task_struct *p,
102
- struct mem_cgroup *memcg, const nodemask_t *nodemask,
113
+long oom_badness(struct task_struct *p,
103114 unsigned long totalpages);
104115
105116 extern bool out_of_memory(struct oom_control *oc);
....@@ -118,4 +129,7 @@
118129 extern int sysctl_oom_dump_tasks;
119130 extern int sysctl_oom_kill_allocating_task;
120131 extern int sysctl_panic_on_oom;
132
+
133
+/* call for adding killed process to reaper. */
134
+extern void add_to_oom_reaper(struct task_struct *p);
121135 #endif /* _INCLUDE_LINUX_OOM_H */