Skip to contentSkip to conversation

mm-memcg-fix-unit-conversion-for-k-macro-in-oom-log.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Dec 23, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: memcg: fix unit conversion for K() macro in OOM log
has been removed from the -mm tree. Its filename was
mm-memcg-fix-unit-conversion-for-k-macro-in-oom-log.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Shakeel Butt <[email protected]>
Subject: mm: memcg: fix unit conversion for K() macro in OOM log
Date: Tue, 16 Dec 2025 13:20:54 -0800

The commit bc8e51c05ad5 ("mm: memcg: dump memcg protection info on oom or alloc failures") added functionality to dump memcg protections on OOM or allocation failures. It uses K() macro to dump the information and passes bytes to the macro. However the macro take number of pages instead of bytes. It is defined as:

#define K(x) ((x) << (PAGE_SHIFT-10))

Let's fix this.

Fixes bc8e51c05ad5 ("mm: memcg: dump memcg protection info on oom or alloc failures")
Cc Johannes Weiner <[email protected]>
Cc Roman Gushchin <[email protected]>

---

 mm/memcontrol.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/memcontrol.c renamed from mm/memcontrol.c~mm-memcg-fix-unit-conversion-for-k-macro-in-oom-log +2 -2
@@ -5638,6 +5638,6 @@ void mem_cgroup_show_protected_memory(st
 		memcg = root_mem_cgroup;
 
 	pr_warn("Memory cgroup min protection %lukB -- low protection %lukB",
-		K(atomic_long_read(&memcg->memory.children_min_usage)*PAGE_SIZE),
-		K(atomic_long_read(&memcg->memory.children_low_usage)*PAGE_SIZE));
+		K(atomic_long_read(&memcg->memory.children_min_usage)),
+		K(atomic_long_read(&memcg->memory.children_low_usage)));
 }

_

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

lib-buildid-use-__kernel_read-for-sleepable-context.patch