Currently the cpu hotplug (bringing the cpu to online/offline state) operations are serialized. I was trying to check the possibilities if certain things can be done in parallel here. (like if we try to bring down two processors at the same moment)
In the cpu offline path, a call is made to __stop_machine (whose description say : This causes a thread to be scheduled on every cpu, each of which disables interrupts. The result is that noone is holding a spinlock or inside any other preempt-disabled region when @fn() runs. This function assumes cpus won't come or go while it's being called. Used by hotplug cpu.) take_cpu_down (which disables the local apic, makes modifications in the ioapic redirection vector table, modifies the state of the cpu maps, sends CPU_DYING to registered callbacks and finally schedules the idle thread) is the function that gets executed in the target cpu (i.e. the cpu that goes offline) during this entire system halt state.
I am just trying to understand the main reason for using stop_machine to run take_cpu_down. What are all the main operations done that expects this state of system?