Re: [PATCH slab/for-next 03/14] lib/xarray: specify SLAB_MAY_ACCOUNT for radix_tree_node cache

From: Hao Li

Date: Thu Dec 03 2026 - 09:28:43 EST


On Wed, Oct 21, 2026 at 12:46:44PM +0100, 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)
>
> Assisted-by: LLM
> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
> Cc: linux-fsdevel@xxxxxxxxxxxxxxx
> Signed-off-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
> ---
> lib/radix-tree.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Looks good to me.
Reviewed-by: Hao Li <hao.li@xxxxxxxxx>

--
Thanks,
Hao