Alexey Dobriyan | 8ac773b | 2006-10-19 23:28:32 -0700 | [diff] [blame] | 1 | #ifndef __INCLUDE_LINUX_OOM_H |
| 2 | #define __INCLUDE_LINUX_OOM_H |
| 3 | |
David Rientjes | 5a3135c | 2007-10-16 23:25:53 -0700 | [diff] [blame] | 4 | #include <linux/sched.h> |
| 5 | |
Alexey Dobriyan | 8ac773b | 2006-10-19 23:28:32 -0700 | [diff] [blame] | 6 | /* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */ |
| 7 | #define OOM_DISABLE (-17) |
| 8 | /* inclusive */ |
| 9 | #define OOM_ADJUST_MIN (-16) |
| 10 | #define OOM_ADJUST_MAX 15 |
| 11 | |
David Rientjes | 5a3135c | 2007-10-16 23:25:53 -0700 | [diff] [blame] | 12 | #ifdef __KERNEL__ |
| 13 | |
David Rientjes | 70e24bd | 2007-10-16 23:25:53 -0700 | [diff] [blame^] | 14 | /* |
| 15 | * Types of limitations to the nodes from which allocations may occur |
| 16 | */ |
| 17 | enum oom_constraint { |
| 18 | CONSTRAINT_NONE, |
| 19 | CONSTRAINT_CPUSET, |
| 20 | CONSTRAINT_MEMORY_POLICY, |
| 21 | }; |
| 22 | |
David Rientjes | 5a3135c | 2007-10-16 23:25:53 -0700 | [diff] [blame] | 23 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order); |
| 24 | extern int register_oom_notifier(struct notifier_block *nb); |
| 25 | extern int unregister_oom_notifier(struct notifier_block *nb); |
| 26 | |
| 27 | #endif /* __KERNEL__*/ |
| 28 | #endif /* _INCLUDE_LINUX_OOM_H */ |