Merge branch 'cfq-2.6.33' into for-2.6.33
[linux-2.6/next.git] / include / linux / oom.h
blob6aac5fe4f6f120db2b2c9b5199d69e7d820d5856
1 #ifndef __INCLUDE_LINUX_OOM_H
2 #define __INCLUDE_LINUX_OOM_H
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
10 #ifdef __KERNEL__
12 #include <linux/types.h>
14 struct zonelist;
15 struct notifier_block;
18 * Types of limitations to the nodes from which allocations may occur
20 enum oom_constraint {
21 CONSTRAINT_NONE,
22 CONSTRAINT_CPUSET,
23 CONSTRAINT_MEMORY_POLICY,
26 extern int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_flags);
27 extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags);
29 extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order);
30 extern int register_oom_notifier(struct notifier_block *nb);
31 extern int unregister_oom_notifier(struct notifier_block *nb);
33 extern bool oom_killer_disabled;
35 static inline void oom_killer_disable(void)
37 oom_killer_disabled = true;
40 static inline void oom_killer_enable(void)
42 oom_killer_disabled = false;
44 #endif /* __KERNEL__*/
45 #endif /* _INCLUDE_LINUX_OOM_H */