cpu hotplug流程
/# /# echo 0 > /sys/devices/system/cpu/cpu1/online
cpu_subsys_offline cpu_down do_cpu_down _cpu_down cpuhp_kick_ap_work __cpuhp_kick_ap_work st->should_run = true; wake_up_process(st->thread); cpuhp_should_run cpuhp_thread_fun cpuhp_ap_offline cpuhp_down_callbacks //迴圈遍歷所有cpuhp_state cpuhp_invoke_callback step = cpuhp_get_step cb = bringup ? step->startup.single : step->teardown.single; cb(cpu); takedown_cpu kthread_park(per_cpu_ptr(&cpuhp_state, cpu)->thread); smpboot_park_threads(cpu) stop_machine(take_cpu_down, NULL, cpumask_of(cpu)); take_cpu_down __cpu_disable __cpu_die //pr_notice("CPU%u: shutdown\n", cpu); op_cpu_kill cpu_ops[cpu]->cpu_kill .cpu_kill = cpu_psci_cpu_kill pr_info("CPU%d killed.\n", cpu);