cpuhp_setup_state_multi(9)
π cpuhp_setup_state_multi(9) π
okay so bestie, you're reading the Kernel API Manual page for cpuhp_setup_state_multi β yes that whole mouthful β and honestly? it's giving "multi-instance era" and we're here for it. let's get into it π«Ά
β¨ NAME β¨
cpuhp_setup_state_multi β Add callbacks for multi state π
π SYNOPSIS π
int cpuhp_setup_state_multi (enum cpuhp_state state , const char *name ,
int (*startup)(unsigned int cpu, struct hlist_node *node) , int
(*teardown)(unsigned int cpu, struct hlist_node *node) );
like, that's the whole signature, no cap. every character matters, so copy it exactly π
π¦ ARGUMENTS π¦
stateβ the state for which the calls are installed. yes, this state. that one. the one you picked πnameβ Name of the callback. keep it cute, keep it accurate β¨startupβ startup callback function, orNULLif it's not required. no startup? no problem πteardownβ teardown callback function, orNULLif it's not required. same vibe, opposite direction π
π DESCRIPTION π
okay so picture this: you call this thing and it Sets the internal multi_instance flag and prepares a state to work as a multi instance callback. that's the whole job, that's the assignment, and it ate. π
and here's the important part, bestie β No callbacks are invoked at this point. not one. zero. it's literally just setting things up, main character energy but backstage. π
the callbacks get invoked once an instance for this state are registered via cpuhp_state_add_instance or cpuhp_state_add_instance_nocalls. so like, you build the stage here, but the show doesn't start until an instance shows up. iykyk πΈ
π₯ SEE ALSO π₯
go read these next, fr fr β the whole friend group:
- Kernel file
./include/linux/cpuhotplug.hπ cpuhp_setup_state(9)cpuhp_setup_state_cpuslocked(9)cpuhp_setup_state_nocalls(9)cpuhp_setup_state_nocalls_cpuslocked(9)cpuhp_state_add_instance(9)cpuhp_state_add_instance_nocalls(9)cpuhp_state_add_instance_nocalls_cpuslocked(9)cpuhp_remove_state(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)
and that's the page!! π this little gem lives in ./include/linux and it's dated October 2026 β so like, mark your calendar bestie, and go register some instances. stay slay, stay locked, and remember: multi state is a lifestyle πβ¨ππ¦
π¦ 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