Re: [PATCH v2] mm/shrinker: Fix refcount leak in shrink_slab_memcg()
From: Suren Baghdasaryan
Date: Wed Apr 15 2026 - 17:27:49 EST
On Tue, Feb 3, 2026 at 8:00 PM Muchun Song <muchun.song@xxxxxxxxx> wrote:
>
>
>
> > On Feb 4, 2026, at 11:35, Altan Hacigumus <ahacigu.linux@xxxxxxxxx> wrote:
> >
> > When kmem is disabled for memcg, slab-backed shrinkers are skipped.
> > However, shrink_slab_memcg() doesn't drop the reference acquired via
> > shrinker_try_get() before continuing.
> >
> > Add the missing shrinker_put().
> >
> > Also, since memcg_kmem_online() and shrinker flags cannot change
> > dynamically, remove the shrinker from the bitmap to avoid unnecessary
> > future scans.
> >
> > Fixes: 50d09da8e119 ("mm: shrinker: make memcg slab shrink lockless")
Sorry for noticing this late but 50d09da8e119 was introduced back in
6.6. Is there a reason this change is not CC'ed to
stable@xxxxxxxxxxxxxxx ?
> > Suggested-by: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
> > Acked-by: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
> > Link: https://lore.kernel.org/r/20260203073757.135088-1-ahacigu.linux@xxxxxxxxx
> > Signed-off-by: Altan Hacigumus <ahacigu.linux@xxxxxxxxx>
>
> Reviewed-by: Muchun Song <muchun.song@xxxxxxxxx>
>
>
>