[PATCH slab/for-next v2 14/14] mm/slab: do not set SLAB_MAY_ACCOUNT for all caches

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Nov 26 11:10:51 UTC 2026


Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] mm/slab: missing short description in SLAB_MAY_ACCOUNT
  kernel-doc comment
--

commit b34eae19fad88ae1a8ba755676d1139c330f19f8
Author: Harry Yoo (Meta) <harry at kernel.org>

mm/slab: do not set SLAB_MAY_ACCOUNT for all caches

This commit stops unconditionally setting SLAB_MAY_ACCOUNT on all slab
caches and updates the kernel-doc comments for SLAB_ACCOUNT and
SLAB_MAY_ACCOUNT.

> diff --git a/include/linux/slab.h b/include/linux/slab.h
> index ad645967a3eea..8525e70eaa76b 100644
> --- a/include/linux/slab.h
> +++ b/include/linux/slab.h
> @@ -201,14 +201,24 @@ enum _slab_flag_bits {
>  /**
>   * define SLAB_ACCOUNT - Account allocations to memcg.
>   *
> - * All object allocations from this cache will be memcg accounted, regardless of
> - * __GFP_ACCOUNT being or not being passed to individual allocations.
> + * All object allocations from this cache will be memcg accounted.
> + * SLAB_ACCOUNT implies SLAB_MAY_ACCOUNT.
>   */
>  #ifdef CONFIG_MEMCG
>  # define SLAB_ACCOUNT		__SLAB_FLAG_BIT(_SLAB_ACCOUNT)
> -# define SLAB_MAY_ACCOUNT	__SLAB_FLAG_BIT(_SLAB_MAY_ACCOUNT)
>  #else
>  # define SLAB_ACCOUNT		__SLAB_FLAG_UNUSED
> +#endif
> +
> +/**
> + * define SLAB_MAY_ACCOUNT
> + *
> + * Objects will be memcg accounted when __GFP_ACCOUNT flag is specified.
> + * Requesting __GFP_ACCOUNT allocations without SLAB_MAY_ACCOUNT is not allowed.
> + */

[Severity: Low]
Should the identifier line for SLAB_MAY_ACCOUNT include a "- <short
description>" suffix, like SLAB_ACCOUNT above?  Without it, running
kernel-doc with -Wall or -Wshort-desc warns about a missing initial short
description.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125-memalloc-prof-dont-waste-slabobj-ext-metadata-v2-0-7c680f02a734@kernel.org?part=14



More information about the Linux-security-module-archive mailing list