Re: [PATCH] mm: memcg-v1: account vmpressure event allocations
From: Tao Cui
Date: Mon Jul 13 2026 - 06:28:54 EST
在 2026/7/13 16:55, Guopeng Zhang 写道:
> From: Guopeng Zhang <zhangguopeng@xxxxxxxxxx>
>
> Commit 72797d218b43 ("mm/memcg: v1: account event registrations and drop
> world-writable cgroup.event_control") accounted cgroup v1 event
> registration allocations with GFP_KERNEL_ACCOUNT, but missed struct
> vmpressure_event.
>
> Use GFP_KERNEL_ACCOUNT for this allocation as well.
>
> Fixes: 72797d218b43 ("mm/memcg: v1: account event registrations and drop world-writable cgroup.event_control")
> Signed-off-by: Guopeng Zhang <zhangguopeng@xxxxxxxxxx>
> ---
> mm/memcontrol-v1.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/memcontrol-v1.c b/mm/memcontrol-v1.c
> index e8b6e1560278..f8424ec3734b 100644
> --- a/mm/memcontrol-v1.c
> +++ b/mm/memcontrol-v1.c
> @@ -1721,7 +1721,7 @@ int vmpressure_register_event(struct mem_cgroup *memcg,
> mode = ret;
> }
>
> - ev = kzalloc_obj(*ev);
> + ev = kzalloc_obj(*ev, GFP_KERNEL_ACCOUNT);
> if (!ev) {
> ret = -ENOMEM;
> goto out;
Acked-by: Tao Cui <cuitao@xxxxxxxxxx>