mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
mm: Adjust tsk_is_oom_victim() for Simple LMK
The page allocator uses tsk_is_oom_victim() to determine when to fast-path memory allocations in order to get an allocating process out of the page allocator and into do_exit() quickly. Unfortunately, tsk_is_oom_victim()'s check to see if a process is killed for OOM purposes is to look for the presence of an OOM reaper artifact that only the OOM killer sets. This means that for processes killed by Simple LMK, there is no fast-pathing done in the page allocator to get them to die faster. Remedy this by changing tsk_is_oom_victim() to look for the existence of the TIF_MEMDIE flag, which Simple LMK sets for its victims. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Signed-off-by: azrim <mirzaspc@gmail.com>
This commit is contained in:
parent
61e01a23a3
commit
0d5e3a232f
@ -64,7 +64,11 @@ static inline bool oom_task_origin(const struct task_struct *p)
|
|||||||
|
|
||||||
static inline bool tsk_is_oom_victim(struct task_struct * tsk)
|
static inline bool tsk_is_oom_victim(struct task_struct * tsk)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_ANDROID_SIMPLE_LMK
|
||||||
|
return test_ti_thread_flag(task_thread_info(tsk), TIF_MEMDIE);
|
||||||
|
#else
|
||||||
return tsk->signal->oom_mm;
|
return tsk->signal->oom_mm;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user