mon_get_kn_priv(9)
β¨ 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 whenrid == 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:
closid_allocated(9)rdtgroup_mode_by_closid(9)rdtgroup_mode_str(9)rdtgroup_remove(9)rdtgroup_tasks_assigned(9)__rdtgroup_cbm_overlaps(9)rdtgroup_cbm_overlaps(9)rdtgroup_mode_test_exclusive(9)rdtgroup_cbm_to_size(9)rdtgroup_kn_mode_restrict(9)rdtgroup_kn_mode_restore(9)mon_put_kn_priv(9)cbm_ensure_valid(9)mongrp_reparent(9)domain_setup_l3_mon_state(9)resctrl_exit(9)
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
- 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