All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua N Pritikin <jpritikin@pobox.com>
To: linux-mm@kvack.org
Subject: [PATCH] allow oom_adj of saintly processes
Date: Sun, 18 Feb 2007 15:13:36 +0530	[thread overview]
Message-ID: <20070218094336.GM11084@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);
 	}
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2007-02-18  9:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18  9:43 Joshua N Pritikin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-02-21 13:06 [PATCH] allow oom_adj of saintly processes Joshua N Pritikin

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=20070218094336.GM11084@always.joy.eth.net \
    --to=jpritikin@pobox.com \
    --cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.