CPU hotplug

Sankar sankar.16 at gmail.com
Sun Jan 3 02:26:47 UTC 2010


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 tried 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 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? Is it because of the cpu maps (which are mostly readonly) getting
modified or the modifications to IOAPIC redirection vector table entries?

Thanks
Sankar



More information about the Fedora-kernel-list mailing list