On Wed, Nov 25, 2026 at 09:37:05PM +0000, Harry Yoo (Meta) wrote:
> Buffer heads are allocated with __GFP_ACCOUNT to charge them to the
> memcg of the folio they are attached to. Specify SLAB_MAY_ACCOUNT when
> the object may be charged to a memcg. __GFP_ACCOUNT without
> SLAB_MAY_ACCOUNT will not be allowed.
>
> Path: ext4_getblk() -> folio_alloc_buffers(GFP_NOFS | __GFP_ACCOUNT)
> -> alloc_buffer_head() -> kmem_cache_zalloc(bh_cachep)
>
> Cc: Alexander Viro <vi…@zeniv.linux.org.uk>
> Cc: Christian Brauner <brau…@kernel.org>
> Cc: Jan Kara <ja…@suse.cz>
> Cc: linu…@vger.kernel.org
> Signed-off-by: Harry Yoo (Meta) <har…@kernel.org>
> ---
> fs/buffer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Looks good to me.
Reviewed-by: Hao Li <hao…@linux.dev>
--
Thanks,
Hao