[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQKkFFxSMBi5EnsQ9-ZwcNqMrUvFM14fV8ehExSEbgY69A@mail.gmail.com>
Date: Tue, 30 Sep 2025 13:04:11 +0200
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Harry Yoo <harry.yoo@...cle.com>
Cc: ranxiaokai627@....com, Vlastimil Babka <vbabka@...e.cz>,
Andrew Morton <akpm@...ux-foundation.org>, cl@...two.org,
David Rientjes <rientjes@...gle.com>, Roman Gushchin <roman.gushchin@...ux.dev>,
Alexei Starovoitov <ast@...nel.org>, LKML <linux-kernel@...r.kernel.org>,
linux-mm <linux-mm@...ck.org>, ran.xiaokai@....com.cn
Subject: Re: [PATCH] slab: Add allow_spin check to eliminate kmemleak warnings
On Tue, Sep 30, 2025 at 10:43 AM Harry Yoo <harry.yoo@...cle.com> wrote:
>
> On Tue, Sep 30, 2025 at 06:38:31AM +0000, ranxiaokai627@....com wrote:
> > From: Ran Xiaokai <ran.xiaokai@....com.cn>
> >
> > In slab_post_alloc_hook(), kmemleak check is skipped when
> > gfpflags_allow_spinning() returns false since commit 13d872ade8be
> > ("slab: Introduce kmalloc_nolock() and kfree_nolock().").
> > Therefore, unconditionally calling kmemleak_not_leak() in
> > alloc_slab_obj_exts() would trigger the following warning:
>
> Good catch.
>
> > kmemleak: Trying to color unknown object at 0xffff8881057f5000 as Grey
> > Call Trace:
> > alloc_slab_obj_exts+0x1b5/0x370
> > __alloc_tagging_slab_alloc_hook+0x9f/0x2d0
> > __kmalloc_cache_noprof+0x1c4/0x5c0
> > __set_page_owner+0x10d/0x1c0
> > post_alloc_hook+0x84/0xf0
> > get_page_from_freelist+0x73b/0x1380
> > __alloc_frozen_pages_noprof+0x110/0x2c0
> > alloc_pages_mpol+0x44/0x140
> > alloc_slab_page+0xac/0x150
> > allocate_slab+0x78/0x3a0
> > ___slab_alloc+0x76b/0xed0
> > __slab_alloc.constprop.0+0x5a/0xb0
> >
> > Add the allow_spin check in alloc_slab_obj_exts() to
> > eliminate the above warning.
> >
> > Fixes: 13d872ade8be ("slab: Introduce kmalloc_nolock() and kfree_nolock().")
>
> The commit hash in the tag and commit message will be adjusted after -rc1
> when picking up this patch.
>
> > Signed-off-by: Ran Xiaokai <ran.xiaokai@....com.cn>
> > ---
>
> Looks good to me,
> Reviewed-by: Harry Yoo <harry.yoo@...cle.com>
Makes sense to me as well:
Acked-by: Alexei Starovoitov <ast@...nel.org>
Powered by blists - more mailing lists