resctrl_arch_cntr_read(9)
π resctrl_arch_cntr_read(9) π
okay bestie, welcome to the Kernel API Manual β¨ β yes this is one of those pages, a kernel function from ./include/linux, and honestly? she's a little niche but she serves π
πΈ NAME πΈ
resctrl_arch_cntr_read β read the event data that corresponds to the counter ID assigned to the RMID, event pair for this resource and domain π«Ά
Like, you've got a counter ID, you've got an RMID + event pairing, and this is the girl that goes and fetches the actual numbers for that specific resource and domain. no cap π
β¨ SYNOPSIS β¨
int resctrl_arch_cntr_read (struct rdt_resource *r , struct
rdt_l3_mon_domain *d , u32 closid , u32 rmid , int cntr_id , enum
resctrl_event_id eventid , u64 *val );
seven whole parameters, she's that girl π₯
π¦ ARGUMENTS π¦
rβ the resource you wanna read the counter from, periodt π«dβ the domain you wanna read the counter from πclosidβ the CLOSID that matches the RMID, they're a matched set, iykyk πrmidβ the RMID thatcntr_idis assigned to π«Άcntr_idβ literally just the counter you're reading bestie πΈeventidβ the MBM event thatcntr_idis assigned to βvalβ the result of the counter read, in bytes π
π DESCRIPTION π
so the vibe here is: this is called on a CPU that belongs to domain d, but only when "mbm_event" mode is enabled π
and then the way it gets called? it's called from a non-migrateable process context via smp_call_on_cpu β unless all CPUs are nohz_full, in which case (plot twist π) it's called via IPI, specifically smp_call_function_any. main character energy from the scheduler ngl π
no cap, that nohz_full caveat is real β the calling path genuinely changes depending on it, so don't come for me if you forgot π
π RETURN π
0 on success bestie π₯³ β or -EIO, -EINVAL etc. on error π (yes, there are others, the manpage says "etc" and I'm not about to invent any, fr fr)
π§ SEE ALSO π§
- Kernel file
./include/linux/resctrl.hπ enum resctrl_conf_type(9)struct resctrl_staged_config(9)struct rdt_domain_hdr(9)struct rdt_ctrl_domain(9)struct mbm_cntr_cfg(9)struct rdt_l3_mon_domain(9)struct resctrl_cache(9)enum membw_throttle_mode(9)struct resctrl_membw(9)enum resctrl_schema_fmt(9)struct resctrl_mon(9)struct rdt_resource(9)struct resctrl_schema(9)resctrl_arch_sync_cpu_closid_rmid(9)resctrl_get_default_ctrl(9)resctrl_arch_mon_event_config_write(9)resctrl_arch_mon_event_config_read(9)resctrl_arch_mbm_cntr_assign_enabled(9)resctrl_arch_mbm_cntr_assign_set(9)resctrl_arch_rmid_read(9)resctrl_arch_rmid_read_context_check(9)resctrl_find_domain(9)resctrl_arch_reset_rmid(9)resctrl_arch_reset_rmid_all(9)resctrl_arch_reset_all_ctrls(9)resctrl_arch_config_cntr(9)resctrl_arch_reset_cntr(9)resctrl_arch_io_alloc_enable(9)resctrl_arch_get_io_alloc_enabled(9)
that's a whole friend group right there, go read all of them, be thorough, slay π β¨
π and that's the page!! π sourced straight from ./include/linux, dated October 2026 β go off, kernel docs, you ate π«Άππ¦β
π¦ 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