Re: [PATCH] mm/mempolicy: convert mempolicy refcnt to refcount_t
From: Zi Yan
Date: Mon Oct 19 2026 - 14:12:45 EST
On 15 Oct 2026, at 19: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>
> ---
> include/linux/mempolicy.h | 5 +++--
> mm/mempolicy.c | 14 +++++++-------
> 2 files changed, 10 insertions(+), 9 deletions(-)
>
LGTM. Thanks.
Acked-by: Zi Yan <ziy@xxxxxxxxxx>
Best Regards,
Yan, Zi