Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __CPUHOTPLUG_H
0003 #define __CPUHOTPLUG_H
0004 
0005 #include <linux/types.h>
0006 
0007 /*
0008  * CPU-up           CPU-down
0009  *
0010  * BP       AP      BP      AP
0011  *
0012  * OFFLINE          OFFLINE
0013  *   |                ^
0014  *   v                |
0015  * BRINGUP_CPU->AP_OFFLINE  BRINGUP_CPU  <- AP_IDLE_DEAD (idle thread/play_dead)
0016  *        |             AP_OFFLINE
0017  *        v (IRQ-off)     ,---------------^
0018  *      AP_ONLNE      | (stop_machine)
0019  *        |     TEARDOWN_CPU <- AP_ONLINE_IDLE
0020  *        |               ^
0021  *        v               |
0022  *              AP_ACTIVE           AP_ACTIVE
0023  */
0024 
0025 /*
0026  * CPU hotplug states. The state machine invokes the installed state
0027  * startup callbacks sequentially from CPUHP_OFFLINE + 1 to CPUHP_ONLINE
0028  * during a CPU online operation. During a CPU offline operation the
0029  * installed teardown callbacks are invoked in the reverse order from
0030  * CPU_ONLINE - 1 down to CPUHP_OFFLINE.
0031  *
0032  * The state space has three sections: PREPARE, STARTING and ONLINE.
0033  *
0034  * PREPARE: The callbacks are invoked on a control CPU before the
0035  * hotplugged CPU is started up or after the hotplugged CPU has died.
0036  *
0037  * STARTING: The callbacks are invoked on the hotplugged CPU from the low level
0038  * hotplug startup/teardown code with interrupts disabled.
0039  *
0040  * ONLINE: The callbacks are invoked on the hotplugged CPU from the per CPU
0041  * hotplug thread with interrupts and preemption enabled.
0042  *
0043  * Adding explicit states to this enum is only necessary when:
0044  *
0045  * 1) The state is within the STARTING section
0046  *
0047  * 2) The state has ordering constraints vs. other states in the
0048  *    same section.
0049  *
0050  * If neither #1 nor #2 apply, please use the dynamic state space when
0051  * setting up a state by using CPUHP_PREPARE_DYN or CPUHP_PREPARE_ONLINE
0052  * for the @state argument of the setup function.
0053  *
0054  * See Documentation/core-api/cpu_hotplug.rst for further information and
0055  * examples.
0056  */
0057 enum cpuhp_state {
0058     CPUHP_INVALID = -1,
0059 
0060     /* PREPARE section invoked on a control CPU */
0061     CPUHP_OFFLINE = 0,
0062     CPUHP_CREATE_THREADS,
0063     CPUHP_PERF_PREPARE,
0064     CPUHP_PERF_X86_PREPARE,
0065     CPUHP_PERF_X86_AMD_UNCORE_PREP,
0066     CPUHP_PERF_POWER,
0067     CPUHP_PERF_SUPERH,
0068     CPUHP_X86_HPET_DEAD,
0069     CPUHP_X86_APB_DEAD,
0070     CPUHP_X86_MCE_DEAD,
0071     CPUHP_VIRT_NET_DEAD,
0072     CPUHP_SLUB_DEAD,
0073     CPUHP_DEBUG_OBJ_DEAD,
0074     CPUHP_MM_WRITEBACK_DEAD,
0075     /* Must be after CPUHP_MM_VMSTAT_DEAD */
0076     CPUHP_MM_DEMOTION_DEAD,
0077     CPUHP_MM_VMSTAT_DEAD,
0078     CPUHP_SOFTIRQ_DEAD,
0079     CPUHP_NET_MVNETA_DEAD,
0080     CPUHP_CPUIDLE_DEAD,
0081     CPUHP_ARM64_FPSIMD_DEAD,
0082     CPUHP_ARM_OMAP_WAKE_DEAD,
0083     CPUHP_IRQ_POLL_DEAD,
0084     CPUHP_BLOCK_SOFTIRQ_DEAD,
0085     CPUHP_BIO_DEAD,
0086     CPUHP_ACPI_CPUDRV_DEAD,
0087     CPUHP_S390_PFAULT_DEAD,
0088     CPUHP_BLK_MQ_DEAD,
0089     CPUHP_FS_BUFF_DEAD,
0090     CPUHP_PRINTK_DEAD,
0091     CPUHP_MM_MEMCQ_DEAD,
0092     CPUHP_XFS_DEAD,
0093     CPUHP_PERCPU_CNT_DEAD,
0094     CPUHP_RADIX_DEAD,
0095     CPUHP_PAGE_ALLOC,
0096     CPUHP_NET_DEV_DEAD,
0097     CPUHP_PCI_XGENE_DEAD,
0098     CPUHP_IOMMU_IOVA_DEAD,
0099     CPUHP_LUSTRE_CFS_DEAD,
0100     CPUHP_AP_ARM_CACHE_B15_RAC_DEAD,
0101     CPUHP_PADATA_DEAD,
0102     CPUHP_AP_DTPM_CPU_DEAD,
0103     CPUHP_RANDOM_PREPARE,
0104     CPUHP_WORKQUEUE_PREP,
0105     CPUHP_POWER_NUMA_PREPARE,
0106     CPUHP_HRTIMERS_PREPARE,
0107     CPUHP_PROFILE_PREPARE,
0108     CPUHP_X2APIC_PREPARE,
0109     CPUHP_SMPCFD_PREPARE,
0110     CPUHP_RELAY_PREPARE,
0111     CPUHP_SLAB_PREPARE,
0112     CPUHP_MD_RAID5_PREPARE,
0113     CPUHP_RCUTREE_PREP,
0114     CPUHP_CPUIDLE_COUPLED_PREPARE,
0115     CPUHP_POWERPC_PMAC_PREPARE,
0116     CPUHP_POWERPC_MMU_CTX_PREPARE,
0117     CPUHP_XEN_PREPARE,
0118     CPUHP_XEN_EVTCHN_PREPARE,
0119     CPUHP_ARM_SHMOBILE_SCU_PREPARE,
0120     CPUHP_SH_SH3X_PREPARE,
0121     CPUHP_NET_FLOW_PREPARE,
0122     CPUHP_TOPOLOGY_PREPARE,
0123     CPUHP_NET_IUCV_PREPARE,
0124     CPUHP_ARM_BL_PREPARE,
0125     CPUHP_TRACE_RB_PREPARE,
0126     CPUHP_MM_ZS_PREPARE,
0127     CPUHP_MM_ZSWP_MEM_PREPARE,
0128     CPUHP_MM_ZSWP_POOL_PREPARE,
0129     CPUHP_KVM_PPC_BOOK3S_PREPARE,
0130     CPUHP_ZCOMP_PREPARE,
0131     CPUHP_TIMERS_PREPARE,
0132     CPUHP_MIPS_SOC_PREPARE,
0133     CPUHP_BP_PREPARE_DYN,
0134     CPUHP_BP_PREPARE_DYN_END        = CPUHP_BP_PREPARE_DYN + 20,
0135     CPUHP_BRINGUP_CPU,
0136 
0137     /*
0138      * STARTING section invoked on the hotplugged CPU in low level
0139      * bringup and teardown code.
0140      */
0141     CPUHP_AP_IDLE_DEAD,
0142     CPUHP_AP_OFFLINE,
0143     CPUHP_AP_SCHED_STARTING,
0144     CPUHP_AP_RCUTREE_DYING,
0145     CPUHP_AP_CPU_PM_STARTING,
0146     CPUHP_AP_IRQ_GIC_STARTING,
0147     CPUHP_AP_IRQ_HIP04_STARTING,
0148     CPUHP_AP_IRQ_APPLE_AIC_STARTING,
0149     CPUHP_AP_IRQ_ARMADA_XP_STARTING,
0150     CPUHP_AP_IRQ_BCM2836_STARTING,
0151     CPUHP_AP_IRQ_MIPS_GIC_STARTING,
0152     CPUHP_AP_IRQ_RISCV_STARTING,
0153     CPUHP_AP_IRQ_LOONGARCH_STARTING,
0154     CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING,
0155     CPUHP_AP_ARM_MVEBU_COHERENCY,
0156     CPUHP_AP_MICROCODE_LOADER,
0157     CPUHP_AP_PERF_X86_AMD_UNCORE_STARTING,
0158     CPUHP_AP_PERF_X86_STARTING,
0159     CPUHP_AP_PERF_X86_AMD_IBS_STARTING,
0160     CPUHP_AP_PERF_X86_CQM_STARTING,
0161     CPUHP_AP_PERF_X86_CSTATE_STARTING,
0162     CPUHP_AP_PERF_XTENSA_STARTING,
0163     CPUHP_AP_MIPS_OP_LOONGSON3_STARTING,
0164     CPUHP_AP_ARM_SDEI_STARTING,
0165     CPUHP_AP_ARM_VFP_STARTING,
0166     CPUHP_AP_ARM64_DEBUG_MONITORS_STARTING,
0167     CPUHP_AP_PERF_ARM_HW_BREAKPOINT_STARTING,
0168     CPUHP_AP_PERF_ARM_ACPI_STARTING,
0169     CPUHP_AP_PERF_ARM_STARTING,
0170     CPUHP_AP_PERF_RISCV_STARTING,
0171     CPUHP_AP_ARM_L2X0_STARTING,
0172     CPUHP_AP_EXYNOS4_MCT_TIMER_STARTING,
0173     CPUHP_AP_ARM_ARCH_TIMER_STARTING,
0174     CPUHP_AP_ARM_GLOBAL_TIMER_STARTING,
0175     CPUHP_AP_JCORE_TIMER_STARTING,
0176     CPUHP_AP_ARM_TWD_STARTING,
0177     CPUHP_AP_QCOM_TIMER_STARTING,
0178     CPUHP_AP_TEGRA_TIMER_STARTING,
0179     CPUHP_AP_ARMADA_TIMER_STARTING,
0180     CPUHP_AP_MARCO_TIMER_STARTING,
0181     CPUHP_AP_MIPS_GIC_TIMER_STARTING,
0182     CPUHP_AP_ARC_TIMER_STARTING,
0183     CPUHP_AP_RISCV_TIMER_STARTING,
0184     CPUHP_AP_CLINT_TIMER_STARTING,
0185     CPUHP_AP_CSKY_TIMER_STARTING,
0186     CPUHP_AP_TI_GP_TIMER_STARTING,
0187     CPUHP_AP_HYPERV_TIMER_STARTING,
0188     CPUHP_AP_KVM_STARTING,
0189     CPUHP_AP_KVM_ARM_VGIC_INIT_STARTING,
0190     CPUHP_AP_KVM_ARM_VGIC_STARTING,
0191     CPUHP_AP_KVM_ARM_TIMER_STARTING,
0192     /* Must be the last timer callback */
0193     CPUHP_AP_DUMMY_TIMER_STARTING,
0194     CPUHP_AP_ARM_XEN_STARTING,
0195     CPUHP_AP_ARM_CORESIGHT_STARTING,
0196     CPUHP_AP_ARM_CORESIGHT_CTI_STARTING,
0197     CPUHP_AP_ARM64_ISNDEP_STARTING,
0198     CPUHP_AP_SMPCFD_DYING,
0199     CPUHP_AP_X86_TBOOT_DYING,
0200     CPUHP_AP_ARM_CACHE_B15_RAC_DYING,
0201     CPUHP_AP_ONLINE,
0202     CPUHP_TEARDOWN_CPU,
0203 
0204     /* Online section invoked on the hotplugged CPU from the hotplug thread */
0205     CPUHP_AP_ONLINE_IDLE,
0206     CPUHP_AP_SCHED_WAIT_EMPTY,
0207     CPUHP_AP_SMPBOOT_THREADS,
0208     CPUHP_AP_X86_VDSO_VMA_ONLINE,
0209     CPUHP_AP_IRQ_AFFINITY_ONLINE,
0210     CPUHP_AP_BLK_MQ_ONLINE,
0211     CPUHP_AP_ARM_MVEBU_SYNC_CLOCKS,
0212     CPUHP_AP_X86_INTEL_EPB_ONLINE,
0213     CPUHP_AP_PERF_ONLINE,
0214     CPUHP_AP_PERF_X86_ONLINE,
0215     CPUHP_AP_PERF_X86_UNCORE_ONLINE,
0216     CPUHP_AP_PERF_X86_AMD_UNCORE_ONLINE,
0217     CPUHP_AP_PERF_X86_AMD_POWER_ONLINE,
0218     CPUHP_AP_PERF_X86_RAPL_ONLINE,
0219     CPUHP_AP_PERF_X86_CQM_ONLINE,
0220     CPUHP_AP_PERF_X86_CSTATE_ONLINE,
0221     CPUHP_AP_PERF_X86_IDXD_ONLINE,
0222     CPUHP_AP_PERF_S390_CF_ONLINE,
0223     CPUHP_AP_PERF_S390_SF_ONLINE,
0224     CPUHP_AP_PERF_ARM_CCI_ONLINE,
0225     CPUHP_AP_PERF_ARM_CCN_ONLINE,
0226     CPUHP_AP_PERF_ARM_HISI_CPA_ONLINE,
0227     CPUHP_AP_PERF_ARM_HISI_DDRC_ONLINE,
0228     CPUHP_AP_PERF_ARM_HISI_HHA_ONLINE,
0229     CPUHP_AP_PERF_ARM_HISI_L3_ONLINE,
0230     CPUHP_AP_PERF_ARM_HISI_PA_ONLINE,
0231     CPUHP_AP_PERF_ARM_HISI_SLLC_ONLINE,
0232     CPUHP_AP_PERF_ARM_HISI_PCIE_PMU_ONLINE,
0233     CPUHP_AP_PERF_ARM_HNS3_PMU_ONLINE,
0234     CPUHP_AP_PERF_ARM_L2X0_ONLINE,
0235     CPUHP_AP_PERF_ARM_QCOM_L2_ONLINE,
0236     CPUHP_AP_PERF_ARM_QCOM_L3_ONLINE,
0237     CPUHP_AP_PERF_ARM_APM_XGENE_ONLINE,
0238     CPUHP_AP_PERF_ARM_CAVIUM_TX2_UNCORE_ONLINE,
0239     CPUHP_AP_PERF_ARM_MARVELL_CN10K_DDR_ONLINE,
0240     CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE,
0241     CPUHP_AP_PERF_POWERPC_CORE_IMC_ONLINE,
0242     CPUHP_AP_PERF_POWERPC_THREAD_IMC_ONLINE,
0243     CPUHP_AP_PERF_POWERPC_TRACE_IMC_ONLINE,
0244     CPUHP_AP_PERF_POWERPC_HV_24x7_ONLINE,
0245     CPUHP_AP_PERF_POWERPC_HV_GPCI_ONLINE,
0246     CPUHP_AP_PERF_CSKY_ONLINE,
0247     CPUHP_AP_WATCHDOG_ONLINE,
0248     CPUHP_AP_WORKQUEUE_ONLINE,
0249     CPUHP_AP_RANDOM_ONLINE,
0250     CPUHP_AP_RCUTREE_ONLINE,
0251     CPUHP_AP_BASE_CACHEINFO_ONLINE,
0252     CPUHP_AP_ONLINE_DYN,
0253     CPUHP_AP_ONLINE_DYN_END     = CPUHP_AP_ONLINE_DYN + 30,
0254     /* Must be after CPUHP_AP_ONLINE_DYN for node_states[N_CPU] update */
0255     CPUHP_AP_MM_DEMOTION_ONLINE,
0256     CPUHP_AP_X86_HPET_ONLINE,
0257     CPUHP_AP_X86_KVM_CLK_ONLINE,
0258     CPUHP_AP_ACTIVE,
0259     CPUHP_ONLINE,
0260 };
0261 
0262 int __cpuhp_setup_state(enum cpuhp_state state, const char *name, bool invoke,
0263             int (*startup)(unsigned int cpu),
0264             int (*teardown)(unsigned int cpu), bool multi_instance);
0265 
0266 int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state, const char *name,
0267                    bool invoke,
0268                    int (*startup)(unsigned int cpu),
0269                    int (*teardown)(unsigned int cpu),
0270                    bool multi_instance);
0271 /**
0272  * cpuhp_setup_state - Setup hotplug state callbacks with calling the @startup
0273  *                     callback
0274  * @state:  The state for which the calls are installed
0275  * @name:   Name of the callback (will be used in debug output)
0276  * @startup:    startup callback function or NULL if not required
0277  * @teardown:   teardown callback function or NULL if not required
0278  *
0279  * Installs the callback functions and invokes the @startup callback on
0280  * the online cpus which have already reached the @state.
0281  */
0282 static inline int cpuhp_setup_state(enum cpuhp_state state,
0283                     const char *name,
0284                     int (*startup)(unsigned int cpu),
0285                     int (*teardown)(unsigned int cpu))
0286 {
0287     return __cpuhp_setup_state(state, name, true, startup, teardown, false);
0288 }
0289 
0290 /**
0291  * cpuhp_setup_state_cpuslocked - Setup hotplug state callbacks with calling
0292  *                @startup callback from a cpus_read_lock()
0293  *                held region
0294  * @state:  The state for which the calls are installed
0295  * @name:   Name of the callback (will be used in debug output)
0296  * @startup:    startup callback function or NULL if not required
0297  * @teardown:   teardown callback function or NULL if not required
0298  *
0299  * Same as cpuhp_setup_state() except that it must be invoked from within a
0300  * cpus_read_lock() held region.
0301  */
0302 static inline int cpuhp_setup_state_cpuslocked(enum cpuhp_state state,
0303                            const char *name,
0304                            int (*startup)(unsigned int cpu),
0305                            int (*teardown)(unsigned int cpu))
0306 {
0307     return __cpuhp_setup_state_cpuslocked(state, name, true, startup,
0308                           teardown, false);
0309 }
0310 
0311 /**
0312  * cpuhp_setup_state_nocalls - Setup hotplug state callbacks without calling the
0313  *                 @startup callback
0314  * @state:  The state for which the calls are installed
0315  * @name:   Name of the callback.
0316  * @startup:    startup callback function or NULL if not required
0317  * @teardown:   teardown callback function or NULL if not required
0318  *
0319  * Same as cpuhp_setup_state() except that the @startup callback is not
0320  * invoked during installation. NOP if SMP=n or HOTPLUG_CPU=n.
0321  */
0322 static inline int cpuhp_setup_state_nocalls(enum cpuhp_state state,
0323                         const char *name,
0324                         int (*startup)(unsigned int cpu),
0325                         int (*teardown)(unsigned int cpu))
0326 {
0327     return __cpuhp_setup_state(state, name, false, startup, teardown,
0328                    false);
0329 }
0330 
0331 /**
0332  * cpuhp_setup_state_nocalls_cpuslocked - Setup hotplug state callbacks without
0333  *                    invoking the @startup callback from
0334  *                    a cpus_read_lock() held region
0335  *                 callbacks
0336  * @state:  The state for which the calls are installed
0337  * @name:   Name of the callback.
0338  * @startup:    startup callback function or NULL if not required
0339  * @teardown:   teardown callback function or NULL if not required
0340  *
0341  * Same as cpuhp_setup_state_nocalls() except that it must be invoked from
0342  * within a cpus_read_lock() held region.
0343  */
0344 static inline int cpuhp_setup_state_nocalls_cpuslocked(enum cpuhp_state state,
0345                              const char *name,
0346                              int (*startup)(unsigned int cpu),
0347                              int (*teardown)(unsigned int cpu))
0348 {
0349     return __cpuhp_setup_state_cpuslocked(state, name, false, startup,
0350                         teardown, false);
0351 }
0352 
0353 /**
0354  * cpuhp_setup_state_multi - Add callbacks for multi state
0355  * @state:  The state for which the calls are installed
0356  * @name:   Name of the callback.
0357  * @startup:    startup callback function or NULL if not required
0358  * @teardown:   teardown callback function or NULL if not required
0359  *
0360  * Sets the internal multi_instance flag and prepares a state to work as a multi
0361  * instance callback. No callbacks are invoked at this point. The callbacks are
0362  * invoked once an instance for this state are registered via
0363  * cpuhp_state_add_instance() or cpuhp_state_add_instance_nocalls()
0364  */
0365 static inline int cpuhp_setup_state_multi(enum cpuhp_state state,
0366                       const char *name,
0367                       int (*startup)(unsigned int cpu,
0368                              struct hlist_node *node),
0369                       int (*teardown)(unsigned int cpu,
0370                               struct hlist_node *node))
0371 {
0372     return __cpuhp_setup_state(state, name, false,
0373                    (void *) startup,
0374                    (void *) teardown, true);
0375 }
0376 
0377 int __cpuhp_state_add_instance(enum cpuhp_state state, struct hlist_node *node,
0378                    bool invoke);
0379 int __cpuhp_state_add_instance_cpuslocked(enum cpuhp_state state,
0380                       struct hlist_node *node, bool invoke);
0381 
0382 /**
0383  * cpuhp_state_add_instance - Add an instance for a state and invoke startup
0384  *                            callback.
0385  * @state:  The state for which the instance is installed
0386  * @node:   The node for this individual state.
0387  *
0388  * Installs the instance for the @state and invokes the registered startup
0389  * callback on the online cpus which have already reached the @state. The
0390  * @state must have been earlier marked as multi-instance by
0391  * cpuhp_setup_state_multi().
0392  */
0393 static inline int cpuhp_state_add_instance(enum cpuhp_state state,
0394                        struct hlist_node *node)
0395 {
0396     return __cpuhp_state_add_instance(state, node, true);
0397 }
0398 
0399 /**
0400  * cpuhp_state_add_instance_nocalls - Add an instance for a state without
0401  *                                    invoking the startup callback.
0402  * @state:  The state for which the instance is installed
0403  * @node:   The node for this individual state.
0404  *
0405  * Installs the instance for the @state. The @state must have been earlier
0406  * marked as multi-instance by cpuhp_setup_state_multi. NOP if SMP=n or
0407  * HOTPLUG_CPU=n.
0408  */
0409 static inline int cpuhp_state_add_instance_nocalls(enum cpuhp_state state,
0410                            struct hlist_node *node)
0411 {
0412     return __cpuhp_state_add_instance(state, node, false);
0413 }
0414 
0415 /**
0416  * cpuhp_state_add_instance_nocalls_cpuslocked - Add an instance for a state
0417  *                       without invoking the startup
0418  *                       callback from a cpus_read_lock()
0419  *                       held region.
0420  * @state:  The state for which the instance is installed
0421  * @node:   The node for this individual state.
0422  *
0423  * Same as cpuhp_state_add_instance_nocalls() except that it must be
0424  * invoked from within a cpus_read_lock() held region.
0425  */
0426 static inline int
0427 cpuhp_state_add_instance_nocalls_cpuslocked(enum cpuhp_state state,
0428                         struct hlist_node *node)
0429 {
0430     return __cpuhp_state_add_instance_cpuslocked(state, node, false);
0431 }
0432 
0433 void __cpuhp_remove_state(enum cpuhp_state state, bool invoke);
0434 void __cpuhp_remove_state_cpuslocked(enum cpuhp_state state, bool invoke);
0435 
0436 /**
0437  * cpuhp_remove_state - Remove hotplug state callbacks and invoke the teardown
0438  * @state:  The state for which the calls are removed
0439  *
0440  * Removes the callback functions and invokes the teardown callback on
0441  * the online cpus which have already reached the @state.
0442  */
0443 static inline void cpuhp_remove_state(enum cpuhp_state state)
0444 {
0445     __cpuhp_remove_state(state, true);
0446 }
0447 
0448 /**
0449  * cpuhp_remove_state_nocalls - Remove hotplug state callbacks without invoking
0450  *              the teardown callback
0451  * @state:  The state for which the calls are removed
0452  */
0453 static inline void cpuhp_remove_state_nocalls(enum cpuhp_state state)
0454 {
0455     __cpuhp_remove_state(state, false);
0456 }
0457 
0458 /**
0459  * cpuhp_remove_state_nocalls_cpuslocked - Remove hotplug state callbacks without invoking
0460  *                     teardown from a cpus_read_lock() held region.
0461  * @state:  The state for which the calls are removed
0462  *
0463  * Same as cpuhp_remove_state nocalls() except that it must be invoked
0464  * from within a cpus_read_lock() held region.
0465  */
0466 static inline void cpuhp_remove_state_nocalls_cpuslocked(enum cpuhp_state state)
0467 {
0468     __cpuhp_remove_state_cpuslocked(state, false);
0469 }
0470 
0471 /**
0472  * cpuhp_remove_multi_state - Remove hotplug multi state callback
0473  * @state:  The state for which the calls are removed
0474  *
0475  * Removes the callback functions from a multi state. This is the reverse of
0476  * cpuhp_setup_state_multi(). All instances should have been removed before
0477  * invoking this function.
0478  */
0479 static inline void cpuhp_remove_multi_state(enum cpuhp_state state)
0480 {
0481     __cpuhp_remove_state(state, false);
0482 }
0483 
0484 int __cpuhp_state_remove_instance(enum cpuhp_state state,
0485                   struct hlist_node *node, bool invoke);
0486 
0487 /**
0488  * cpuhp_state_remove_instance - Remove hotplug instance from state and invoke
0489  *                               the teardown callback
0490  * @state:  The state from which the instance is removed
0491  * @node:   The node for this individual state.
0492  *
0493  * Removes the instance and invokes the teardown callback on the online cpus
0494  * which have already reached @state.
0495  */
0496 static inline int cpuhp_state_remove_instance(enum cpuhp_state state,
0497                           struct hlist_node *node)
0498 {
0499     return __cpuhp_state_remove_instance(state, node, true);
0500 }
0501 
0502 /**
0503  * cpuhp_state_remove_instance_nocalls - Remove hotplug instance from state
0504  *                   without invoking the teardown callback
0505  * @state:  The state from which the instance is removed
0506  * @node:   The node for this individual state.
0507  *
0508  * Removes the instance without invoking the teardown callback.
0509  */
0510 static inline int cpuhp_state_remove_instance_nocalls(enum cpuhp_state state,
0511                               struct hlist_node *node)
0512 {
0513     return __cpuhp_state_remove_instance(state, node, false);
0514 }
0515 
0516 #ifdef CONFIG_SMP
0517 void cpuhp_online_idle(enum cpuhp_state state);
0518 #else
0519 static inline void cpuhp_online_idle(enum cpuhp_state state) { }
0520 #endif
0521 
0522 #endif