Re: [PATCH] mm/mempolicy: convert mempolicy refcnt to refcount_t
From: David Hildenbrand (Arm)
Date: Fri Oct 16 2026 - 03:55:14 EST
On 10/16/26 01:13, Gregory Price (Meta) wrote:
> struct mempolicy uses an atomic_t as a pure reference counter.
>
> Convert it to refcount_t so that overflow and underflow are caught
> by the refcount saturation checks.
>
> This silences the atomic_as_refcounter.cocci warning, which started
> matching __mpol_put() when it switched kmem_cache_free() to kfree_rcu().
>
> No functional change for correct callers.
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202610061946.Bx22ZFrw-lkp@xxxxxxxxx/
> Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>
> ---
Wondering if we want a Fixes? If this only fixes cocci warnings I guess not.
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David