oom.h 858 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __INCLUDE_LINUX_OOM_H
  2. #define __INCLUDE_LINUX_OOM_H
  3. /* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
  4. #define OOM_DISABLE (-17)
  5. /* inclusive */
  6. #define OOM_ADJUST_MIN (-16)
  7. #define OOM_ADJUST_MAX 15
  8. #ifdef __KERNEL__
  9. #include <linux/types.h>
  10. struct zonelist;
  11. struct notifier_block;
  12. /*
  13. * Types of limitations to the nodes from which allocations may occur
  14. */
  15. enum oom_constraint {
  16. CONSTRAINT_NONE,
  17. CONSTRAINT_CPUSET,
  18. CONSTRAINT_MEMORY_POLICY,
  19. };
  20. extern int try_set_zone_oom(struct zonelist *zonelist);
  21. extern void clear_zonelist_oom(struct zonelist *zonelist);
  22. extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order);
  23. extern int register_oom_notifier(struct notifier_block *nb);
  24. extern int unregister_oom_notifier(struct notifier_block *nb);
  25. #endif /* __KERNEL__*/
  26. #endif /* _INCLUDE_LINUX_OOM_H */