mod_lruvec_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mod_lruvec_state β€” kernel API manual, section 9, bestie edition πŸŽ€

okay so real talk: this one lives in the Kernel API Manual, section 9, and it's the lil function that keeps your lruvec memory stats from lying to you. no cap, it's giving "quietly holding the whole memory accounting system together" energy. πŸ‘‘


✨ NAME ✨

mod_lruvec_state β€” update lruvec memory statistics 🌸


✨ SYNOPSIS ✨

void mod_lruvec_state (struct lruvec *lruvec , enum node_stat_item idx ,
       int val );

like literally that's the whole signature, she's not complicated πŸ’–


✨ ARGUMENTS ✨

  • lruvec β€” the lruvec itself. yes, THE lruvec. the whole point. 🫢
  • idx β€” the stat item you're clocking. which counter are we vibing with today? ⭐
  • val β€” the delta you're adding to the counter. and yes bestie, it can be negative β€” we go both ways here, increments and decrements, no judgement πŸ’€

✨ DESCRIPTION ✨

so quick lore drop 🧚: the lruvec is the intersection of the NUMA node and a cgroup. like that's the exact meeting point of those two things, that's her whole identity.

what mod_lruvec_state does is update all three counters that get affected when the state changes at this level:

  • per-node
  • per-cgroup
  • per-lruvec

three counters, one call, she ate and left no crumbs πŸ”₯ the way that one function keeps all three in sync so nothing drifts... iconic behaviour honestly πŸ‘‘


✨ SEE ALSO ✨

Kernel file ./mm/memcontrol.c β€” and like, the entire extended friend group πŸ’œ:

that's a whole group chat right there, go say hi to all of them πŸ¦‹


and that's the page!! πŸ“ this one's sourced from ./mm, dated October 2026, and it's mod_lruvec_state(9) β€” mwah, go update those stats responsibly bestie πŸ’…πŸ’–

πŸ“¦ where this page comes from