public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joshua N Pritikin <jpritikin@pobox.com>
To: linux-kernel@vger.kernel.org
Cc: trivial@kernel.org
Subject: [PATCH] allow oom_adj of saintly processes
Date: Wed, 21 Feb 2007 18:36:00 +0530	[thread overview]
Message-ID: <20070221130600.GD7322@always.joy.eth.net> (raw)

If the badness of a process is zero then oom_adj>0 has no effect. This 
patch makes sure that the oom_adj shift actually increases badness 
points appropriately.

I am not subscribed. Please CC me with any comments. Thanks.

Signed-off-by: Joshua N. Pritikin <jpritikin@pobox.com>

--- linux/mm/oom_kill.c.orig	2007-02-18 14:58:35.000000000 +0530
+++ linux/mm/oom_kill.c	2007-02-18 14:57:52.000000000 +0530
@@ -147,9 +147,11 @@ unsigned long badness(struct task_struct
 	 * Adjust the score by oomkilladj.
 	 */
 	if (p->oomkilladj) {
-		if (p->oomkilladj > 0)
+		if (p->oomkilladj > 0) {
+			if (!points)
+				points = 1;
 			points <<= p->oomkilladj;
-		else
+		} else
 			points >>= -(p->oomkilladj);
 	}
 

                 reply	other threads:[~2007-02-21 13:34 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=20070221130600.GD7322@always.joy.eth.net \
    --to=jpritikin@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trivial@kernel.org \
    /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