From 4eaf22f2455486b2e85ab22a8112ac2e0c37d6a9 Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Fri, 5 Jan 2007 16:37:03 -0800 Subject: [PATCH] --- yaml --- r: 45301 b: refs/heads/master c: 7ba3485947ee7bc89a17f86250fe9b692a615dff h: refs/heads/master i: 45299: cd2cd728e1789ce8a840664e93bf96c0cc0de485 v: v3 --- [refs] | 2 +- trunk/mm/oom_kill.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 9c65d5146dc5..1a8711461ac3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c8af57eb76fbd70c7f5b421b065fd55d096e2bff +refs/heads/master: 7ba3485947ee7bc89a17f86250fe9b692a615dff diff --git a/trunk/mm/oom_kill.c b/trunk/mm/oom_kill.c index 6969cfb33901..b278b8d60eee 100644 --- a/trunk/mm/oom_kill.c +++ b/trunk/mm/oom_kill.c @@ -60,12 +60,6 @@ unsigned long badness(struct task_struct *p, unsigned long uptime) return 0; } - /* - * swapoff can easily use up all memory, so kill those first. - */ - if (p->flags & PF_SWAPOFF) - return ULONG_MAX; - /* * The memory size of the process is the basis for the badness. */ @@ -76,6 +70,12 @@ unsigned long badness(struct task_struct *p, unsigned long uptime) */ task_unlock(p); + /* + * swapoff can easily use up all memory, so kill those first. + */ + if (p->flags & PF_SWAPOFF) + return ULONG_MAX; + /* * Processes which fork a lot of child processes are likely * a good choice. We add half the vmsize of the children if they