Blame view
include/linux/oom.h
1.93 KB
8ac773b4f
|
1 2 |
#ifndef __INCLUDE_LINUX_OOM_H #define __INCLUDE_LINUX_OOM_H |
a63d83f42
|
3 |
/* |
51b1bd2ac
|
4 5 6 |
* /proc/<pid>/oom_adj is deprecated, see * Documentation/feature-removal-schedule.txt. * |
a63d83f42
|
7 8 |
* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */ |
8ac773b4f
|
9 10 11 12 |
#define OOM_DISABLE (-17) /* inclusive */ #define OOM_ADJUST_MIN (-16) #define OOM_ADJUST_MAX 15 |
a63d83f42
|
13 14 15 16 17 18 |
/* * /proc/<pid>/oom_score_adj set to OOM_SCORE_ADJ_MIN disables oom killing for * pid. */ #define OOM_SCORE_ADJ_MIN (-1000) #define OOM_SCORE_ADJ_MAX 1000 |
5a3135c2e
|
19 |
#ifdef __KERNEL__ |
a63d83f42
|
20 |
#include <linux/sched.h> |
172acf60f
|
21 |
#include <linux/types.h> |
4365a5676
|
22 |
#include <linux/nodemask.h> |
172acf60f
|
23 24 25 |
struct zonelist; struct notifier_block; |
74bcbf405
|
26 27 |
struct mem_cgroup; struct task_struct; |
172acf60f
|
28 |
|
70e24bdf6
|
29 30 31 32 33 34 35 |
/* * Types of limitations to the nodes from which allocations may occur */ enum oom_constraint { CONSTRAINT_NONE, CONSTRAINT_CPUSET, CONSTRAINT_MEMORY_POLICY, |
309ed8825
|
36 |
CONSTRAINT_MEMCG, |
70e24bdf6
|
37 |
}; |
a63d83f42
|
38 39 |
extern unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *mem, const nodemask_t *nodemask, unsigned long totalpages); |
ff321feac
|
40 |
extern int try_set_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
dd1a239f6
|
41 |
extern void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_flags); |
098d7f128
|
42 |
|
4365a5676
|
43 44 |
extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, int order, nodemask_t *mask); |
5a3135c2e
|
45 46 |
extern int register_oom_notifier(struct notifier_block *nb); extern int unregister_oom_notifier(struct notifier_block *nb); |
1a8670a29
|
47 48 49 50 51 52 53 54 55 56 57 |
extern bool oom_killer_disabled; static inline void oom_killer_disable(void) { oom_killer_disabled = true; } static inline void oom_killer_enable(void) { oom_killer_disabled = false; } |
8e4228e1e
|
58 |
|
74bcbf405
|
59 60 61 |
/* The badness from the OOM killer */ extern unsigned long badness(struct task_struct *p, struct mem_cgroup *mem, const nodemask_t *nodemask, unsigned long uptime); |
158e0a2d1
|
62 |
extern struct task_struct *find_lock_task_mm(struct task_struct *p); |
8e4228e1e
|
63 64 65 66 |
/* sysctls */ extern int sysctl_oom_dump_tasks; extern int sysctl_oom_kill_allocating_task; extern int sysctl_panic_on_oom; |
5a3135c2e
|
67 68 |
#endif /* __KERNEL__*/ #endif /* _INCLUDE_LINUX_OOM_H */ |