mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
mm: add a helper function to check may oom condition
Use helper function to check if we need to deal with oom condition. Signed-off-by: Qiang Huang <h.huangqiang@huawei.com> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
9c2606b77d
commit
b9921ecdee
3 changed files with 7 additions and 9 deletions
|
@ -82,6 +82,11 @@ static inline void oom_killer_enable(void)
|
|||
oom_killer_disabled = false;
|
||||
}
|
||||
|
||||
static inline bool oom_gfp_allowed(gfp_t gfp_mask)
|
||||
{
|
||||
return (gfp_mask & __GFP_FS) && !(gfp_mask & __GFP_NORETRY);
|
||||
}
|
||||
|
||||
extern struct task_struct *find_lock_task_mm(struct task_struct *p);
|
||||
|
||||
/* sysctls */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue