aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/oom_kill.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 55a05f1ef76d..f1aba7e7b760 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -60,6 +60,12 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
60 } 60 }
61 61
62 /* 62 /*
63 * swapoff can easily use up all memory, so kill those first.
64 */
65 if (p->flags & PF_SWAPOFF)
66 return ULONG_MAX;
67
68 /*
63 * The memory size of the process is the basis for the badness. 69 * The memory size of the process is the basis for the badness.
64 */ 70 */
65 points = mm->total_vm; 71 points = mm->total_vm;
@@ -230,8 +236,6 @@ static struct task_struct *select_bad_process(unsigned long *ppoints)
230 } 236 }
231 if (p->oomkilladj == OOM_DISABLE) 237 if (p->oomkilladj == OOM_DISABLE)
232 continue; 238 continue;
233 if (p->flags & PF_SWAPOFF)
234 return p;
235 239
236 points = badness(p, uptime.tv_sec); 240 points = badness(p, uptime.tv_sec);
237 if (points > *ppoints || !chosen) { 241 if (points > *ppoints || !chosen) {