mm: memcg-v1: account vmpressure event allocations

Commit 72797d218b ("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.

Link: https://lore.kernel.org/20260713085520.2953121-1-guopeng.zhang@linux.dev
Fixes: 72797d218b ("mm/memcg: v1: account event registrations and drop world-writable cgroup.event_control")
Signed-off-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
Acked-by: Tao Cui <cuitao@kylinos.cn>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Guopeng Zhang
2026-07-13 16:55:20 +08:00
committed by Andrew Morton
parent 72f522bbf4
commit 466dd08cdc

View File

@@ -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;