mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-18 12:46:11 +07:00
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: Joshua N. Pritikin <jpritikin@pobox.com> Cc: Andrea Arcangeli <andrea@novell.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3d67f2d7c0
commit
9a82782f8f
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user