rdtgroup_cbm_to_size(9)
π 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 thatdbelongs 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:cbmisunsigned 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 π:
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_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)domain_setup_l3_mon_state(9)resctrl_exit(9)
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
- 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