oom.h 701 B

12345678910111213141516171819202122232425262728
  1. #ifndef __INCLUDE_LINUX_OOM_H
  2. #define __INCLUDE_LINUX_OOM_H
  3. #include <linux/sched.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
  9. #ifdef __KERNEL__
  10. /*
  11. * Types of limitations to the nodes from which allocations may occur
  12. */
  13. enum oom_constraint {
  14. CONSTRAINT_NONE,
  15. CONSTRAINT_CPUSET,
  16. CONSTRAINT_MEMORY_POLICY,
  17. };
  18. extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order);
  19. extern int register_oom_notifier(struct notifier_block *nb);
  20. extern int unregister_oom_notifier(struct notifier_block *nb);
  21. #endif /* __KERNEL__*/
  22. #endif /* _INCLUDE_LINUX_OOM_H */