Skip to contentSkip to conversation

mm-oom-keep-oom_adj-under-or-at-upper-limit-when-printing.patch removed from -mm tree

merged [email protected] 1 participant 1 message Nov 3, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: mm, oom: keep oom_adj under or at upper limit when printing
has been removed from the -mm tree. Its filename was
mm-oom-keep-oom_adj-under-or-at-upper-limit-when-printing.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Charles Haithcock <[email protected]>
Subject: mm, oom: keep oom_adj under or at upper limit when printing

For oom_score_adj values in the range [942,999], the current calculations will print 16 for oom_adj. This patch simply limits the output so output is inline with docs.

---

 fs/proc/base.c |    2 ++
 1 file changed, 2 insertions(+)
fs/proc/base.c renamed from fs/proc/base.c~mm-oom-keep-oom_adj-under-or-at-upper-limit-when-printing +2 -0
@@ -1049,6 +1049,8 @@ static ssize_t oom_adj_read(struct file
 		oom_adj = (task->signal->oom_score_adj * -OOM_DISABLE) /
 			  OOM_SCORE_ADJ_MAX;
 	put_task_struct(task);
+	if (oom_adj > OOM_ADJUST_MAX)
+		oom_adj = OOM_ADJUST_MAX;
 	len = snprintf(buffer, sizeof(buffer), "%d\n", oom_adj);
 	return simple_read_from_buffer(buf, count, ppos, buffer, len);
 }

_

Patches currently in -mm which might be from [email protected] are