Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a82782f authored by Joshua N Pritikin's avatar Joshua N Pritikin Committed by Linus Torvalds
Browse files

allow oom_adj of saintly processes



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.

Signed-off-by: default avatarJoshua N. Pritikin <jpritikin@pobox.com>
Cc: Andrea Arcangeli <andrea@novell.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3d67f2d7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -147,9 +147,11 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
	 * 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);
	}