[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC] KEXEC: allocate crash note buffers at boot time
On 29/11/2011 18:56, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx> wrote: > Hello, > > As I have little to no knowledge of this stage of the boot process, is > this a sensible way to be setting up the per_cpu areas? I have a > sneaking suspicion that it will fall over if a CPU is onlined after > boot, and may also fall over if a CPU is offlined and reonlined later. > There appears to be no infrastructure currently in place for this type > of initialization, which is quite possibly why the code exists in its > current form. No it's bad. For starters you should use for_each_online_cpu, not do an open-coded for-loop. Secondly you should register a cpu hotplug notifier (register_cpu_notifier()) to pick up and handle future CPU_UP_PREPARE/CPU_UP_CANCELED/CPU_DEAD events. This can be hung off an __initcall. See common/stop_machine.c for example, or common/timer.c, which doesn't even require a for_each_online_cpu loop because its init code gets run before we bring up secondary CPUs. -- Keir > Thanks, _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |