Re: [Fastboot] Re: [PATCH][4/6]Register snapshotting before kexec boot

From: Dipankar Sarma
Date: Thu Sep 16 2004 - 03:41:07 EST


On Wed, Sep 15, 2004 at 02:27:22PM -0700, Andrew Morton wrote:
> Hariprasad Nellitheertha <hari@xxxxxxxxxx> wrote:
> > +void __crash_dump_stop_cpus(void)
> > +{
> > + int i, cpu = smp_processor_id();
> > + int other_cpus = num_online_cpus()-1;
> > +
> > + if (other_cpus > 0) {
> > + atomic_set(&waiting_for_dump_ipi, other_cpus);
> > +
> > + for (i = 0; i < NR_CPUS; i++)
> > + crash_dump_expect_ipi[i] = (i != cpu && cpu_online(i));
> > +
> > + set_nmi_callback(crash_dump_nmi_callback);
> > + /* Ensure the new callback function is set before sending
> > + * out the IPI
> > + */
> > + wmb();
> > +
> > + crash_dump_send_ipi();
> > + while (atomic_read(&waiting_for_dump_ipi) > 0)
> > + cpu_relax();
> > +
> > + unset_nmi_callback();
> > + } else {
> > + local_irq_disable();
> > + disable_local_APIC();
> > + local_irq_enable();
> > + }
> > +}
>
> Is dodgy wrt CPU hotplug, but there's not a lot we can do about that
> in this context, I expect. Which is a shame, given that CPU hotplug
> is a likely time at which to be taking a crashdump ;)

If Hari disables preemption during this entire section of code,
he should be safe from CPU hotplug, AFAICS. The stop machine
threads will never get to run on that CPU.

Thanks
Dipankar
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/