STRUCT CPUHP_CPU_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct cpuhp_cpu_state(9)

okay so bestie, this page comes from the Kernel API Manual (section 9, the kernel-internals girlies) and it's literally all about struct cpuhp_cpu_state β€” the per-CPU hotplug state storage. it's giving "where a CPU keeps its own little diary of what state it's in." no cap.


✨ NAME ✨

struct cpuhp_cpu_state β€” per cpu hotplug state storage 🫢

like, per CPU. each one gets their own. main character energy for every core.


🌸 SYNOPSIS 🌸

here's the whole vibe, exactly as it is, don't @ me:

struct cpuhp_cpu_state {
    enum cpuhp_state        state;
    enum cpuhp_state        target;
    enum cpuhp_state        fail;
  #ifdef CONFIG_SMP;
    struct task_struct      *thread;
    bool should_run;
    bool rollback;
    bool single;
    bool bringup;
    struct hlist_node       *node;
    struct hlist_node       *last;
    enum cpuhp_state        cb_state;
    int result;
    atomic_t ap_sync_state;
    struct completion       done_up;
    struct completion       done_down;
  #endif;
 };
🚨 bestie look at that #ifdef CONFIG_SMP; β€” everything below it only exists when CONFIG_SMP is set. no SMP, no thread field, no completions, nothing. she said "not today."

πŸŽ€ Members πŸŽ€

like a group photo, one by one, no one left out:

  • state β€” the current cpu state. where she's at right now πŸ’β€β™€οΈ
  • target β€” the target state. where she's trying to go. the goal. the vision board.
  • fail β€” current CPU hotplug callback state. (yes it's named fail, she's just built different πŸ₯²)
  • thread β€” pointer to the hotplug thread. the one doing the actual work, honestly iconic.
  • should_run β€” thread should execute. a whole bool just to say "go bestie."
  • rollback β€” perform a rollback. we're taking it back, no shame.
  • single β€” single callback invocation. just one. a little solo moment.
  • bringup β€” single callback bringup or teardown selector. which direction are we going, up or down? selector energy.
  • node β€” remote CPU node; for multi-instance, do a single entry callback for install/remove.
  • last β€” for multi-instance rollback, remember how far we got. the receipts πŸ“
  • cb_state β€” the state for a single callback (install/uninstall).
  • result β€” result of the operation. did we slay or did we flop, that's the whole field.
  • ap_sync_state β€” state for AP synchronization.
  • done_up β€” signal completion to the issuer of the task for cpu-up. ⬆️ done!
  • done_down β€” signal completion to the issuer of the task for cpu-down. ⬇️ done!

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, in ./kernel/cpu.c:

iykyk πŸ’œ


and that's the page!! sourced straight from ./kernel, dated October 2026 ⭐ β€” go off, kernel girlies, this one's for you πŸ§šπŸ’–

πŸ“¦ where this page comes from