summaryrefslogtreecommitdiff
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorZihan Xi <zihanx@nebusec.ai>2026-07-31 16:46:23 +0000
committerJakub Kicinski <kuba@kernel.org>2026-08-05 19:32:39 -0700
commitb0057c68df711bf6a62033c072ac61c4f9d3cbc1 (patch)
tree7a7f00ccb7405c457b97df9b39fab61b4aa093fd /include/uapi/linux
parentd21a374995df9d7cfd193427748a19dcc87956a9 (diff)
xsk: account ring allocations to memcg
AF_XDP rings are allocated from setsockopt() and can be mapped into user space. The shared xskq_create() helper allocates the ring backing memory, but the user-controlled and long-lived allocation is not charged as kmem to the allocating memory cgroup. The current implementation uses vmalloc_user(), which allocates the backing pages with GFP_KERNEL | __GFP_ZERO. Use the same VM_USERMAP vmalloc path, but pass GFP_KERNEL_ACCOUNT so the ring backing pages are attributed to memcg/kmem and can be constrained by existing cgroup memory limits. This keeps the existing zeroing and mmap semantics while avoiding AF_XDP-specific optmem or RLIMIT_MEMLOCK accounting. Signed-off-by: Zihan Xi <zihanx@nebusec.ai> Acked-by: Stanislav Fomichev <sdf@fomichev.me> Link: https://patch.msgid.link/20260731164623.4694-2-zihanx@nebusec.ai Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/uapi/linux')
0 files changed, 0 insertions, 0 deletions