diff options
Diffstat (limited to 'include/linux/oom.h')
-rw-r--r-- | include/linux/oom.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/linux/oom.h b/include/linux/oom.h index 40e5e3a6bc20..73b8d7b6dd19 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
@@ -1,14 +1,24 @@ | |||
1 | #ifndef __INCLUDE_LINUX_OOM_H | 1 | #ifndef __INCLUDE_LINUX_OOM_H |
2 | #define __INCLUDE_LINUX_OOM_H | 2 | #define __INCLUDE_LINUX_OOM_H |
3 | 3 | ||
4 | /* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */ | 4 | /* |
5 | * /proc/<pid>/oom_adj set to -17 protects from the oom-killer | ||
6 | */ | ||
5 | #define OOM_DISABLE (-17) | 7 | #define OOM_DISABLE (-17) |
6 | /* inclusive */ | 8 | /* inclusive */ |
7 | #define OOM_ADJUST_MIN (-16) | 9 | #define OOM_ADJUST_MIN (-16) |
8 | #define OOM_ADJUST_MAX 15 | 10 | #define OOM_ADJUST_MAX 15 |
9 | 11 | ||
12 | /* | ||
13 | * /proc/<pid>/oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for | ||
14 | * pid. | ||
15 | */ | ||
16 | #define OOM_SCORE_ADJ_MIN (-1000) | ||
17 | #define OOM_SCORE_ADJ_MAX 1000 | ||
18 | |||
10 | #ifdef __KERNEL__ | 19 | #ifdef __KERNEL__ |
11 | 20 | ||
21 | #include <linux/sched.h> | ||
12 | #include <linux/types.h> | 22 | #include <linux/types.h> |
13 | #include <linux/nodemask.h> | 23 | #include <linux/nodemask.h> |
14 | 24 | ||
@@ -27,6 +37,8 @@ enum oom_constraint { | |||
27 | CONSTRAINT_MEMCG, | 37 | CONSTRAINT_MEMCG, |
28 | }; | 38 | }; |
29 | 39 | ||
40 | extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, | ||
41 | const nodemask_t *nodemask, unsigned long totalpages); | ||
30 | extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 42 | extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
31 | extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | 43 | extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
32 | 44 | ||