]>
Commit | Line | Data |
---|---|---|
8ac773b4 AD |
1 | #ifndef __INCLUDE_LINUX_OOM_H |
2 | #define __INCLUDE_LINUX_OOM_H | |
3 | ||
4 | /* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */ | |
5 | #define OOM_DISABLE (-17) | |
6 | /* inclusive */ | |
7 | #define OOM_ADJUST_MIN (-16) | |
8 | #define OOM_ADJUST_MAX 15 | |
9 | ||
5a3135c2 DR |
10 | #ifdef __KERNEL__ |
11 | ||
172acf60 | 12 | #include <linux/types.h> |
4365a567 | 13 | #include <linux/nodemask.h> |
172acf60 DR |
14 | |
15 | struct zonelist; | |
16 | struct notifier_block; | |
17 | ||
70e24bdf DR |
18 | /* |
19 | * Types of limitations to the nodes from which allocations may occur | |
20 | */ | |
21 | enum oom_constraint { | |
22 | CONSTRAINT_NONE, | |
23 | CONSTRAINT_CPUSET, | |
24 | CONSTRAINT_MEMORY_POLICY, | |
309ed882 | 25 | CONSTRAINT_MEMCG, |
70e24bdf DR |
26 | }; |
27 | ||
dd1a239f MG |
28 | extern int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
29 | extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); | |
098d7f12 | 30 | |
4365a567 KH |
31 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, |
32 | int order, nodemask_t *mask); | |
5a3135c2 DR |
33 | extern int register_oom_notifier(struct notifier_block *nb); |
34 | extern int unregister_oom_notifier(struct notifier_block *nb); | |
35 | ||
1a8670a2 AD |
36 | extern bool oom_killer_disabled; |
37 | ||
38 | static inline void oom_killer_disable(void) | |
39 | { | |
40 | oom_killer_disabled = true; | |
41 | } | |
42 | ||
43 | static inline void oom_killer_enable(void) | |
44 | { | |
45 | oom_killer_disabled = false; | |
46 | } | |
8e4228e1 DR |
47 | |
48 | /* sysctls */ | |
49 | extern int sysctl_oom_dump_tasks; | |
50 | extern int sysctl_oom_kill_allocating_task; | |
51 | extern int sysctl_panic_on_oom; | |
5a3135c2 DR |
52 | #endif /* __KERNEL__*/ |
53 | #endif /* _INCLUDE_LINUX_OOM_H */ |