STRUCT CPUHP_STEP(9)
β¨ struct cpuhp_step(9) β¨
okay so bestie, welcome to the Kernel API Manual π
we're looking at struct cpuhp_step(9) and honestly? it's giving main character energy in the CPU hotplug world. π«Ά
πΈ NAME πΈ
struct cpuhp_step β the Hotplug state machine step β¨ lowkey the little building block that makes the whole hotplug dance work, no cap.
π¦ SYNOPSIS π¦
struct cpuhp_step {
const char *name;
union {
int (*single)(unsigned int cpu);
int (*multi)(unsigned int cpu, struct hlist_node *node);
} startup;
union {
int (*single)(unsigned int cpu);
int (*multi)(unsigned int cpu, struct hlist_node *node);
} teardown;
bool cant_stop;
bool multi_instance;
};
like, that's the whole vibe right there β¬οΈ copy it exactly, don't come for me π
π Members π
nameβ the name of the step, literally its whole identity πͺͺstartupβ the startup function of the step, aka what it does when things spin up π₯teardownβ the teardown function</teardown> of the step, aka the goodbye routine when things wind down πcant_stopβ aboolthat says bringup/teardown can't be stopped at this step π like, no take-backsies, periodtmulti_instanceβ aboolmeaning the state has multiple instances which get added afterwards π (yes, plural, she's multifaceted)
π‘ quick vibe check:startupandteardownare each aunionof a single and a multi function pointer βsingletakes(unsigned int cpu),multitakes(unsigned int cpu, struct hlist_node *node). iykyk π§
β SEE ALSO β
go bestie, go read these too, they're all icons fr fr:
- Kernel file
./kernel/cpu.cstruct cpuhp_cpu_state(9) cpuhp_invoke_callback(9)cpuhp_ap_update_sync_state(9)cpuhp_ap_report_dead(9)cpuhp_ap_sync_alive(9)clear_tasks_mm_cpumask(9)cpu_device_down(9)notify_cpu_starting(9)cpu_device_up(9)bringup_hibernate_cpu(9)__cpuhp_setup_state_cpuslocked(9)__cpuhp_remove_state_cpuslocked(9)
and that's the tea π this lil page lives under ./kernel, dated October 2026, and it's part of the Kernel API Manual β slay, go hotplug some CPUs 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