bpf_mem_cgroup_vm_events(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bpf_mem_cgroup_vm_events(9) ✨

okay so real quick β€” this is a page from the Kernel API Manual, and it's about peeking at a memory cgroup's vm event counter. yes bestie, we're doing kernel internals today, and honestly? it's giving main character energy πŸŽ€


🌸 NAME 🌸

bpf_mem_cgroup_vm_events β€” literally just read a memory cgroup's vm event counter, that's the whole gig 🫢


⭐ SYNOPSIS ⭐

__bpf_kfunc unsigned long bpf_mem_cgroup_vm_events (struct mem_cgroup
*memcg , enum vm_event_item event );

that's the signature, copy it exactly, no cap πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • memcg β€” the memory cgroup, aka the thing you're curious about πŸ‘€
  • event β€” the event id, aka which counter you wanna see 🎯

✨ DESCRIPTION ✨

okay so this one is lowkey simple and I'm obsessed: it lets you read memory cgroup event counters. that's it. that's the function. iconic behaviour, actually 🌈

you hand it a memcg and an event id, and it goes and fetches you that counter. no drama, no side quests. periodt πŸ’œ


πŸ‘‘ RETURN πŸ‘‘

it returns the current value of the corresponding events counter, as an unsigned long. so like, the number you asked for, fresh out of the cgroup ⭐


πŸ”₯ SEE ALSO πŸ”₯

the kernel file lives at ./mm/bpf_memcontrol.c β€” that's where the magic happens, iykyk 🧚

and here's the whole friend group, all (9) sections, all worth a read:

like yes, get you a kfunc family that supports you πŸ™ˆπŸ’–


so yeah, that's the page bestie! it's from ./mm, dated October 2026 β€” future vibes, slay πŸ¦‹ mwah, go read your memory cgroups responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from