[PATCH] bugfix in oom_kill.c

From: Chris Swiedler (chris.swiedler@sevista.com)
Date: Tue Nov 14 2000 - 12:22:49 EST


This patch fixes a bug in oom_kill. The way it was written, the OOM killer
would try to kill the idle task if the task selected immediately before it
had the most "badness". Probably because of the order of for_each_task(),
this wouldn't ever happen, but I don't think we want to depend on that.

chris

--- official/linux-2.4.0/mm/oom_kill.c Mon Nov 6 23:53:01 2000
+++ work/linux-2.4.0-test10/mm/oom_kill.c Thu Nov 9 23:12:10 2000
@@ -124,11 +143,12 @@
         read_lock(&tasklist_lock);
         for_each_task(p)
         {
- if (p->pid)
+ if (p->pid) {
                         points = badness(p);
- if (points > maxpoints) {
- chosen = p;
- maxpoints = points;
+ if (points > maxpoints) {
+ chosen = p;
+ maxpoints = points;
+ }
                 }
         }
         read_unlock(&tasklist_lock);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Nov 15 2000 - 21:00:26 EST