cpuhp_remove_state(9)
π cpuhp_remove_state(9) β Kernel API Manual π
okay so bestie, we're in the cpuhp_remove_state(9) manpage, from the Kernel API Manual β yes the whole manual, and yes this page is a baddie. sit down, grab a strawberry π, and let's talk about taking hotplug state callbacks out.
β¨ NAME β¨
cpuhp_remove_state β remove hotplug state callbacks and invoke the teardown. like, the full send. you're not just ghosting the callbacks, you're throwing the goodbye party too π«Ά
πΈ SYNOPSIS πΈ
void cpuhp_remove_state (enum cpuhp_state state );
no cap, that's the whole signature. short, iconic, does exactly one thing π
π¦ ARGUMENTS π¦
stateβ the state for which the calls are removed. literally the state whose callbacks are getting evicted. everything happens relative to this state, so get it right the first time, iykyk π
π₯ DESCRIPTION π₯
So here's the tea β: cpuhp_remove_state removes the callback functions and invokes the teardown callback on the online cpus which have already reached the state.
Read that again, bestie, because this is the important part β it's a two-parter:
- removes the callback functions β the callbacks are gone, bye bye π
- invokes the teardown callback β and then it actually runs the teardown, but only on the online cpus that have already reached the state.
not every cpu. not the offline ones. only the online ones that got there. main character energy for real β it only deals with the cpus that are actually in the room π§
the vibe check: "remove" + "invoke the teardown" together, in one call. that's the whole point of this function, and it's the difference between this and the _nocalls versions hanging out in SEE ALSO. don't get it twisted π
π SEE ALSO π
kernel file ./include/linux/cpuhotplug.h β and the whole friend group right here, all of them, every single one:
cpuhp_setup_state(9)cpuhp_setup_state_cpuslocked(9)cpuhp_setup_state_nocalls(9)cpuhp_setup_state_nocalls_cpuslocked(9)cpuhp_setup_state_multi(9)cpuhp_state_add_instance(9)cpuhp_state_add_instance_nocalls(9)cpuhp_state_add_instance_nocalls_cpuslocked(9)cpuhp_remove_state_nocalls(9)cpuhp_remove_state_nocalls_cpuslocked(9)cpuhp_remove_multi_state(9)cpuhp_state_remove_instance(9)cpuhp_state_remove_instance_nocalls(9)
ngl, the _nocalls ones are right there if you don't want the teardown invoked. peek at the one that matches your vibe before you commit, bestie π
and that's the page!! π this lil beauty lives in ./include/linux, and it's serving October 2026 energy β so when you cite it, that's the source and the date, periodt. go forth and remove those states, icon πβ¨
π¦ 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