domain_setup_l3_mon_state(9)
π domain_setup_l3_mon_state(9) π
okay so bestie, welcome to the Kernel API Manual β¨ β yes this is a kernel manpage, yes it's section 9, and yes we're gonna make it make sense. this one's about domain_setup_l3_mon_state, and it's honestly giving "small function, big responsibilities" π
β¨ NAME β¨
domain_setup_l3_mon_state β literally just initialising the domain monitoring structures. that's the whole job. no cap. π
πΈ SYNOPSIS πΈ
int domain_setup_l3_mon_state (struct rdt_resource *r , struct
rdt_l3_mon_domain *d );
that's it, that's the whole signature π«Ά
π¦ ARGUMENTS π¦
rβ the resource that belongs to the newly online domain. the resource. for the domain. the new one. π«dβ the newly online domain itself. hi bestie, welcome online πβ¨
π DESCRIPTION π
okay so here's the tea: this function allocates the monitor resources that belong to this domain. that's the whole vibe check.
it gets called when the first CPU of a domain comes online β and here's the iconic part β regardless of whether the filesystem is mounted π like, mounted or not, it's showing up. main character energy fr fr.
during boot, this may get called before the global allocations have been made by resctrl_l3_mon_resource_init. so yeah, sometimes it runs early to the party, before the party's even set up π
it's also called during CPU online, which may run as soon as the CPU online callbacks are set up during resctrl initialization. and the number of supported RMIDs may be reduced if additional mon_capable resources are enumerated at mount time. which means β and this is the important bit, don't skip it β the rdt_l3_mon_domain::mbm_states[] and rdt_l3_mon_domain::rmid_busy_llc allocations may be larger than needed π« not a bug, just a little extra. slay.
π§ RETURN π§
0for success π-ENOMEMwhen the memory said no π
π SEE ALSO π
the kernel file ./fs/resctrl/rdtgroup.c and its whole friend group β no literally, all of them, we're not leaving anyone out:
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_get_kn_priv(9)mon_put_kn_priv(9)cbm_ensure_valid(9)mongrp_reparent(9)resctrl_exit(9)
also lowkey a heads-up: thembm_states[]andrmid_busy_llcallocations can end up bigger than they need to be. that's documented behaviour, not a glitch, so don't come for it π
and that's the whole page bestie π«Ά it's from ./fs/resctrl, dated October 2026, and it's genuinely iconic that you read all the way to the end of a section 9 manpage β obsessed, honestly ππβ¨
π¦ 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