cpuhp_setup_state_multi(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, or NULL if it's not required. no startup? no problem πŸ“
  • teardown β€” teardown callback function, or NULL if 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:


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