vmpressure_register_event(9)
π vmpressure_register_event (kernel API manual, bestie!) π
okay so real talk, this one's from the Kernel API Manual and it's genuinely such a vibe once you get what it's doing. sit down, grab a strawberry, we're linking memory pressure to an eventfd and it's gonna slay πβ¨
πΈ NAME πΈ
vmpressure_register_event β bind vmpressure notifications to an eventfd π
like, that's literally it. that's the whole thing. notifications β eventfd. iconic behavior.
β SYNOPSIS β
int vmpressure_register_event (struct mem_cgroup *memcg , struct
eventfd_ctx *eventfd , const char *args );
no cap, that's the exact signature, character for character, don't come for me π«Ά
π¦ ARGUMENTS π¦
memcgβ themem_cgroupthat's interested in vmpressure notifications. this is the main character of the operation tbh πeventfdβ theeventfd_ctxwe're linking notifications with. the messenger bestie πargsβ the event arguments: a pressure level threshold, plus an optional mode. yes it's a string, yes it's parsed, we'll get to it π
π DESCRIPTION π
so what this function does is associate that eventfd context with the vmpressure infrastructure, so the notifications get delivered to the eventfd. literally the whole point. slay π
the args parameter is a comma-delimited string that denotes a pressure level threshold β one of vmpressure_str_levels, i.e. "low", "medium", or "critical" β and an optional mode, which is one of vmpressure_str_modes, i.e. "hierarchy" or "local".
that's the tea: threshold first, mode optional. iykyk π§
also important: to be used as an memcg event method. periodt.
π₯ RETURN π₯
0on success π-ENOMEMon memory failure π-EINVALifargscould not be parsed π
ngl the -EINVAL one is giving "check your comma string, bestie" energy. vibe check your args before you call this fr fr π
π SEE ALSO π
kernel file ./mm/memcontrol-v1.c, plus these icons:
__memcg1_swapout(9)memcg1_swapin(9)mem_cgroup_oom_synchronize(9)vmpressure_prio(9)vmpressure_unregister_event(9)
and that's the whole page, bestie π«Ά this one lives over in ./mm and it's dated October 2026 β shoutout to the source/version and date, we love a documented footer β¨πΈ go forth and register those events π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms