cbm_ensure_valid(9)
π cbm_ensure_valid β the kernel API manual, but make it make sense
okay bestie, pull up a chair, because we're talking about cbm_ensure_valid(9) β yes that's the page header, and yes I'm folding it in right here at the top like a lil name tag π. The manual is literally called Kernel API Manual, and the star of the show is cbm_ensure_valid, which Enforce[s] validity on provided CBM. slay.
β¨ NAME β¨
cbm_ensure_valid β Enforce validity on provided CBM. that's it, that's the vibe check π
πΈ SYNOPSIS πΈ
u32 cbm_ensure_valid (u32 _val , struct rdt_resource *r );
look at her. tiny. iconic. two arguments and a dream β¨
π¦ ARGUMENTS π¦
_valβ the Candidate CBM. your little hopeful bitmap, fresh out of the box, not yet judged πrβ the RDT resource to which the CBM belongs. every CBM needs a home, and this is hers π‘
π DESCRIPTION π
okay so here's the tea β. The provided CBM represents all cache portions available for use. sounds great right? WRONG (well, not wrong, justβ¦ complicated). This may be represented by a bitmap that does not consist of contiguous ones β which means it's literally an invalid CBM. π not me showing up with a non-contiguous bitmap, embarrassing.
So here's what happens: the provided CBM is forced to be a valid CBM by only considering the first set of contiguous bits as valid, and clearing all bits. like, we take the first cute lil run of ones and we're like "okay bestie you're the whole personality now" and everything else gets yeeted π.
The intention here β and this is the important part, iykyk β is to provide a valid default CBM with which a new resource group is initialized. it's giving starter-pack energy π. The user can follow this with a modification to the CBM if the default does not satisfy the requirements. so like, it's a starting point, not a forever commitment. no cap π«Ά
β RETURN β
A CBM that is valid for resource r. that's it. that's the return. she delivers π
π SEE ALSO π
Kernel file ./fs/resctrl/rdtgroup.c, plus the whole friend group β because nobody functions alone, bestie:
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)mongrp_reparent(9)domain_setup_l3_mon_state(9)resctrl_exit(9)
π real talk though: if your CBM isn't contiguous ones, it's getting trimmed to the first contiguous set and all the other bits get cleared. that's not a bug, that's the whole point β but maybe don't be surprised when it happens, mmkay?
and that's the page, bestie!! π sign-off time: this lil masterpiece lives in ./fs/resctrl, dated October 2026 β so she's from the future, obviously. periodt. ππ§ββοΈπΈ
π¦ 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