Linux 2.6.33-rc2
[pohmelfs.git] / include / linux / oom.h
blob537662315627375555939bbcea2375fa7928968b
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>
13 #include <linux/nodemask.h>
15 struct zonelist;
16 struct notifier_block;
19 * Types of limitations to the nodes from which allocations may occur
21 enum oom_constraint {
22 CONSTRAINT_NONE,
23 CONSTRAINT_CPUSET,
24 CONSTRAINT_MEMORY_POLICY,
27 extern int try_set_zone_oom(struct zonelist *zonelist, gfp_t gfp_flags);
28 extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags);
30 extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
31 int order, nodemask_t *mask);
32 extern int register_oom_notifier(struct notifier_block *nb);
33 extern int unregister_oom_notifier(struct notifier_block *nb);
35 extern bool oom_killer_disabled;
37 static inline void oom_killer_disable(void)
39 oom_killer_disabled = true;
42 static inline void oom_killer_enable(void)
44 oom_killer_disabled = false;
46 #endif /* __KERNEL__*/
47 #endif /* _INCLUDE_LINUX_OOM_H */