lkml.org 
[lkml]   [2000]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] bugfix in oom_kill.c
Date
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/

\
 
 \ /
  Last update: 2005-03-22 12:45    [W:0.022 / U:34.752 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site