X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=mm%2Foom_kill.c;h=b278b8d60eee4ac13bba50222c478901cff39a60;hb=1004879f25c5719517b3d8a3180a517e190e2f5b;hp=6969cfb33901e1e21defc992eda34cd0d6363264;hpb=96ac5913f4e45c6a1b98350f2c0a8bb3abe2646a;p=mv-sheeva.git diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 6969cfb3390..b278b8d60ee 100644 --- a/mm/oom_kill.c +++ b/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