diff options
Diffstat (limited to 'include/linux/oom.h')
| -rw-r--r-- | include/linux/oom.h | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/include/linux/oom.h b/include/linux/oom.h index 853698c721f7..d5771bed59c9 100644 --- a/include/linux/oom.h +++ b/include/linux/oom.h | |||
| @@ -47,6 +47,10 @@ static inline bool oom_task_origin(const struct task_struct *p) | |||
| 47 | return !!(p->signal->oom_flags & OOM_FLAG_ORIGIN); | 47 | return !!(p->signal->oom_flags & OOM_FLAG_ORIGIN); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | extern void mark_tsk_oom_victim(struct task_struct *tsk); | ||
| 51 | |||
| 52 | extern void unmark_oom_victim(void); | ||
| 53 | |||
| 50 | extern unsigned long oom_badness(struct task_struct *p, | 54 | extern unsigned long oom_badness(struct task_struct *p, |
| 51 | struct mem_cgroup *memcg, const nodemask_t *nodemask, | 55 | struct mem_cgroup *memcg, const nodemask_t *nodemask, |
| 52 | unsigned long totalpages); | 56 | unsigned long totalpages); |
| @@ -68,27 +72,14 @@ extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task, | |||
| 68 | unsigned long totalpages, const nodemask_t *nodemask, | 72 | unsigned long totalpages, const nodemask_t *nodemask, |
| 69 | bool force_kill); | 73 | bool force_kill); |
| 70 | 74 | ||
| 71 | extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, | 75 | extern bool out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, |
| 72 | int order, nodemask_t *mask, bool force_kill); | 76 | int order, nodemask_t *mask, bool force_kill); |
| 73 | extern int register_oom_notifier(struct notifier_block *nb); | 77 | extern int register_oom_notifier(struct notifier_block *nb); |
| 74 | extern int unregister_oom_notifier(struct notifier_block *nb); | 78 | extern int unregister_oom_notifier(struct notifier_block *nb); |
| 75 | 79 | ||
| 76 | extern bool oom_killer_disabled; | 80 | extern bool oom_killer_disabled; |
| 77 | 81 | extern bool oom_killer_disable(void); | |
| 78 | static inline void oom_killer_disable(void) | 82 | extern void oom_killer_enable(void); |
| 79 | { | ||
| 80 | oom_killer_disabled = true; | ||
| 81 | } | ||
| 82 | |||
| 83 | static inline void oom_killer_enable(void) | ||
| 84 | { | ||
| 85 | oom_killer_disabled = false; | ||
| 86 | } | ||
| 87 | |||
| 88 | static inline bool oom_gfp_allowed(gfp_t gfp_mask) | ||
| 89 | { | ||
| 90 | return (gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY); | ||
| 91 | } | ||
| 92 | 83 | ||
| 93 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); | 84 | extern struct task_struct *find_lock_task_mm(struct task_struct *p); |
| 94 | 85 | ||
