resctrl_arch_cntr_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 that cntr_id is assigned to 🫢
  • cntr_id β€” literally just the counter you're reading bestie 🌸
  • eventid β€” the MBM event that cntr_id is 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 🧚

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