linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Chris Swiedler" <chris.swiedler@sevista.com>
To: <torvalds@transmeta.com>, "Linux-Kernel" <linux-kernel@vger.kernel.org>
Subject: [PATCH] bugfix in oom_kill.c
Date: Tue, 14 Nov 2000 12:22:49 -0500	[thread overview]
Message-ID: <NDBBIAJKLMMHOGKNMGFNEEJFCPAA.chris.swiedler@sevista.com> (raw)

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/

                 reply	other threads:[~2000-11-14 17:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=NDBBIAJKLMMHOGKNMGFNEEJFCPAA.chris.swiedler@sevista.com \
    --to=chris.swiedler@sevista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).