Re: [PATCH] mm: memcg: fix unit conversion for K() macro in OOM log
From: Muchun Song
Date: Tue Dec 16 2025 - 21:36:01 EST
> On Dec 17, 2025, at 05:20, Shakeel Butt <shakeel.butt@xxxxxxxxx> wrote:
>
> 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.
>
> Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> Reported-by: Chris Mason <clm@xxxxxx>
> Fixes: bc8e51c05ad5 ("mm: memcg: dump memcg protection info on oom or alloc failures")
Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>
Thanks.