Re: [PATCH slab/for-next v2 04/14] fs/buffer: specify SLAB_MAY_ACCOUNT for buffer_head cache
From: Harry Yoo
Date: Thu Nov 26 2026 - 09:23:52 EST
On Thu, Nov 26, 2026 at 10:05:35AM +0100, Jan Kara wrote:
> On Wed 25-11-26 21:37:05, 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 <viro@xxxxxxxxxxxxxxxxxx>
> > Cc: Christian Brauner <brauner@xxxxxxxxxx>
> > Cc: Jan Kara <jack@xxxxxxx>
> > Cc: linux-fsdevel@xxxxxxxxxxxxxxx
> > Signed-off-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
>
> Looks good. Feel free to add:
Thank you for reviewing them, Jan!
> Acked-by: Jan Kara <jack@xxxxxxx>
--
Cheers,
Harry / Hyeonggon