|
|
@@ -174,8 +174,13 @@ unsigned long oom_badness(struct task_struct *p, struct mem_cgroup *memcg,
|
|
|
if (!p)
|
|
|
return 0;
|
|
|
|
|
|
+ /*
|
|
|
+ * Do not even consider tasks which are explicitly marked oom
|
|
|
+ * unkillable or have been already oom reaped.
|
|
|
+ */
|
|
|
adj = (long)p->signal->oom_score_adj;
|
|
|
- if (adj == OOM_SCORE_ADJ_MIN) {
|
|
|
+ if (adj == OOM_SCORE_ADJ_MIN ||
|
|
|
+ test_bit(MMF_OOM_REAPED, &p->mm->flags)) {
|
|
|
task_unlock(p);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -513,7 +518,7 @@ static bool __oom_reap_task(struct task_struct *tsk)
|
|
|
* This task can be safely ignored because we cannot do much more
|
|
|
* to release its memory.
|
|
|
*/
|
|
|
- tsk->signal->oom_score_adj = OOM_SCORE_ADJ_MIN;
|
|
|
+ set_bit(MMF_OOM_REAPED, &mm->flags);
|
|
|
out:
|
|
|
mmput(mm);
|
|
|
return ret;
|