Re: [PATCH] mm/mempolicy: convert mempolicy refcnt to refcount_t

From: SJ Park

Date: Thu Oct 15 2026 - 19:46:38 EST


On Thu, 15 Oct 2026 19:13:22 -0400 "Gregory Price (Meta)" <gourry@xxxxxxxxxx> 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.

Looks correct to me.

>
> 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>

Reviewed-by: SJ Park <sj@xxxxxxxxxx>


Thanks,
SJ

[...]