Re: [PATCH] mm/kmemleak: Fix percpu memory leak detection failure

From: Catalin Marinas
Date: Tue Dec 31 2024 - 07:04:05 EST


On Fri, Dec 27, 2024 at 11:42:49AM +0100, Uros Bizjak wrote:
> On Fri, Dec 27, 2024 at 11:37 AM Uros Bizjak <ubizjak@xxxxxxxxx> wrote:
> > On Fri, Dec 27, 2024 at 10:23 AM Guo Weikang
> > <guoweikang.kernel@xxxxxxxxx> wrote:
> > > kmemleak_alloc_percpu gives an incorrect min_count parameter, causing
> > > percpu memory to be considered a gray object.
> > >
> > > Fixes: 8c8685928910 ("mm/kmemleak: use IS_ERR_PCPU() for pointer in the percpu address space")
> > >
> > > Signed-off-by: Guo Weikang <guoweikang.kernel@xxxxxxxxx>
> >
> > I don't know how 1 turned to 0, the change was definitely unintended.
>
> Looking at the original patch at [1], it looks like a mismerge to me.
>
> [1] https://lore.kernel.org/all/20240818210235.33481-2-ubizjak@xxxxxxxxx/T/#u

About the same time we had commit 6c99d4eb7c5e ("kmemleak: enable
tracking for percpu pointers") increasing min_count to 1 but in the
merge this got lost.

--
Catalin