rdtgroup_cbm_to_size(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– rdtgroup_cbm_to_size(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ β€” this one's rdtgroup_cbm_to_size, and it's genuinely such a useful little function, no cap.


🌸 NAME 🌸

rdtgroup_cbm_to_size β€” Translate CBM to size in bytes


πŸŽ€ SYNOPSIS πŸŽ€

unsigned int rdtgroup_cbm_to_size (struct rdt_resource *r , struct
       rdt_ctrl_domain *d , unsigned long cbm );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • r β€” the RDT resource that d belongs to. like, its home resource 🏠
  • d β€” the RDT domain instance. this is the domain we're doing the math on πŸ’…
  • cbm β€” the bitmask for which the size should be computed. the star of the show ⭐

✨ DESCRIPTION ✨

so the bitmask you hand in, associated with the RDT domain instance d, gets translated into how many bytes it represents πŸ’– the way it works is genuinely so clean: the size in bytes is computed by first dividing the total cache size by the CBM length to figure out how many bytes each bit in the bitmask represents. then that result gets multiplied by the number of bits set in the bitmask. that's it. that's the whole vibe. math ate, fr fr πŸ”₯

little detail you don't wanna miss: cbm is unsigned long, even if only 32 bits are used β€” that's on purpose, to make the bitmap functions work correctly 🫢

πŸ‘‘ RETURN πŸ‘‘

Size (in bytes) of the cache portion represented by the CBM, and 0 on failure. so if you get a zero back, that's your cue to go 😭 and check what went wrong.


🌈 SEE ALSO 🌈

Kernel file ./fs/resctrl/rdtgroup.c plus the whole friend group πŸ’œ:


okay that's the whole page, bestie β€” go forth and translate those bitmasks πŸ’…βœ¨ this came to you from ./fs/resctrl, dated October 2026, and it's rdtgroup_cbm_to_size(9) signing off πŸŽ€πŸ«ΆπŸ’–

πŸ“¦ where this page comes from