Re: [PATCH slab/for-next v2 10/14] fanotify: specify SLAB_MAY_ACCOUNT for event caches

From: Hao Li

Date: Thu Dec 03 2026 - 10:03:33 EST


On Wed, Nov 25, 2026 at 09:37:11PM +0000, Harry Yoo (Meta) wrote:
> fanotify events are allocated with GFP_KERNEL_ACCOUNT and charged to
> the memcg of the listener. Specify SLAB_MAY_ACCOUNT when the object
> may be charged to a memcg. __GFP_ACCOUNT without SLAB_MAY_ACCOUNT
> will not be allowed.
>
> Path: fsnotify() -> fanotify_handle_event()
> -> fanotify_alloc_event(GFP_KERNEL_ACCOUNT)
> -> kmem_cache_alloc(fanotify_{fid,path,perm,mnt}_event_cachep)
>
> Cc: Jan Kara <jack@xxxxxxx>
> Cc: Amir Goldstein <amir73il@xxxxxxxxx>
> Cc: linux-fsdevel@xxxxxxxxxxxxxxx
> Signed-off-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
> ---
> fs/notify/fanotify/fanotify_user.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)

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

--
Thanks,
Hao