resctrl_exit(9)
π resctrl_exit(9) β a Kernel API Manual moment β¨
okay bestie, buckle up, we're in the kernel API manual today (yes, the manual, we're fancy now π) and this little function is lowkey one of the most dramatic exits in the whole filesystem game. no cap.
πΈ NAME πΈ
resctrl_exit β the one that removes the resctrl filesystem and frees the resources. it's giving cleanup era, it's giving "we're so done here" π
β¨ SYNOPSIS β¨
void resctrl_exit (void );
literally nothing to pass in, she takes no notes, she takes no prisoners π«Ά
π¦ ARGUMENTS π¦
voidβ no arguments. none. zero. she needs nothing from you, main character energy fr fr π
π DESCRIPTION π
so here's the tea β β the architecture code calls this one in response to a fatal error. yeah, we're in our crisis-management era π. what she does is remove the resctrl files and structures from kernfs so nobody can be out here doing further configuration. configuration is cancelled. the vibe has been shut down.
β οΈ okay this part matters, bestie, don't skip it: when the architecture code calls resctrl_exit, all CPUs and resctrl domains must be offline. this is not a suggestion, this is the whole reason the thing is safe.
why tho? because when everything's offline, that ensures the limbo and overflow handlers are not scheduled to run π β which means the data structures they access can actually be freed by resctrl_l3_mon_resource_exit. like, they're not gonna reach back in and grab something that's already been yeeted π.
after resctrl_exit returns, the architecture code should return an error from all resctrl_arch_ functions that can do this. all of them. periodt.
and here's the iconic little twist π: resctrl_arch_get_resource must continue to return struct rdt_resources with the correct rid field β because that's what ensures the filesystem can be unmounted. she's still doing her job even after the party's over, we stan a reliable queen π«Ά
π§ SEE ALSO π§
the whole friend group got invited to this section, so let's give them their moment π:
- Kernel file
./fs/resctrl/rdtgroup.c 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)cbm_ensure_valid(9)mongrp_reparent(9)domain_setup_l3_mon_state(9)
like, that's the whole gc in one list π₯
and that's the page!! π this little icon came straight out of ./fs/resctrl, dated October 2026, in her full resctrl_exit(9) era. bye bestie, go free those resources responsibly πβ¨
π¦ 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