mon_get_kn_priv(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ mon_get_kn_priv(9) β€” like, the Kernel API Manual page, bestie ✨

okay so you're deep in the kernel docs (iconic of you, honestly) and you clicked on the mon_get_kn_priv page from the Kernel API Manual β€” welcome, this is your moment 🫢


🌸 NAME 🌸

mon_get_kn_priv β€” grab the mon_data priv data for this event. that's the whole vibe πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct mon_data * mon_get_kn_priv (enum resctrl_res_level rid , int
       domid , struct mon_evt *mevt , bool do_sum );

πŸŽ€ ARGUMENTS πŸŽ€

  • rid β€” the resource id for the event file being created. like, which resource we're talking about, bestie.
  • domid β€” the domain id for the event file being created. your domain, your rules ✨
  • mevt β€” the type of event file being created. what kind of event are we even doing here.
  • do_sum β€” whether SNC summing monitors are being created. and listen, it's only set when rid == RDT_RESOURCE_L3 β€” so like, that's the only time it's relevant, no cap 🧚

πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• β€” the same values get used across the mon_data directories of all control and monitor groups for the same event, in the same domain. literally all of them, same values, every time.

so what do we do about it? keep a list of the structures we've already allocated, and re-use an existing one with the same values for rid, domid, etc. don't be out here making duplicates when a perfectly good one is sitting right there β€” that's giving wasteful energy and we don't do that πŸ’€


πŸ‘‘ RETURN πŸ‘‘

a pointer to the mon_data private data of the event πŸ’« …or NULL on failure 😭 (we've all been there).


🌈 SEE ALSO 🌈

the kernel file ./fs/resctrl/rdtgroup.c, plus these absolute icons β€” go give them a read, iykyk:


and that's the page, bestie πŸ“ this one lives in ./fs/resctrl, dated October 2026, and it's literally called mon_get_kn_priv(9) β€” slay, go read the source, mwah πŸ’œ

πŸ“¦ where this page comes from