[PATCH slab/for-next v2 03/14] lib/xarray: specify SLAB_MAY_ACCOUNT for radix_tree_node cache
Hao Li
hao.li at linux.dev
Thu Dec 3 14:41:14 UTC 2026
On Wed, Nov 25, 2026 at 09:37:04PM +0000, Harry Yoo (Meta) wrote:
> XArrays with XA_FLAGS_ACCOUNT (e.g. the page cache) allocate nodes with
> __GFP_ACCOUNT, and xarray/IDR callers can also pass GFP_KERNEL_ACCOUNT
> directly. Specify SLAB_MAY_ACCOUNT when the object may be charged to a
> memcg. __GFP_ACCOUNT without SLAB_MAY_ACCOUNT will not be allowed.
>
> Path: __filemap_add_folio() (i_pages has XA_FLAGS_ACCOUNT)
> -> xas_store() -> xas_alloc() (gfp |= __GFP_ACCOUNT)
> -> kmem_cache_alloc_lru(radix_tree_node_cachep)
>
> Cc: Matthew Wilcox <willy at infradead.org>
> Cc: linux-fsdevel at vger.kernel.org
> Signed-off-by: Harry Yoo (Meta) <harry at kernel.org>
> ---
> lib/radix-tree.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Looks good to me.
Reviewed-by: Hao Li <hao.li at linux.dev>
--
Thanks,
Hao
More information about the Linux-security-module-archive
mailing list