lkml.org 
[lkml]   [2012]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 01/27] smpboot: Provide a generic method to boot secondary processors
    On 06/03/2012 02:23 PM, Yong Zhang wrote:

    > On Fri, Jun 01, 2012 at 05:39:27PM +0530, Srivatsa S. Bhat wrote:
    >> +void __cpuinit smpboot_start_secondary(void *arg)
    >> +{
    >> + unsigned int cpu;
    >> +
    >> + /*
    >> + * SMP booting is extremely fragile in some architectures. So run
    >> + * the cpu initialization code first before anything else.
    >> + */
    >> + __cpu_pre_starting(arg);
    >> +
    >> + preempt_disable();
    >> + cpu = smp_processor_id();
    >> +
    >> + /* Invoke the CPU_STARTING notifier callbacks */
    >> + notify_cpu_starting(cpu);
    >> +
    >> + __cpu_pre_online(arg);
    >> +
    >> + /* Set the CPU in the cpu_online_mask */
    >> + set_cpu_online(cpu, true);
    >> +
    >> + __cpu_post_online(arg);
    >> +
    >
    > Seems it worth to catch incorrect irq state here:
    >
    > WARN_ON_ONCE(!irqs_disabled());
    >


    That's a good point! But unfortunately we can't do that just yet.
    Because, some architectures have explicit comments that say that
    irqs must be enabled at a certain point in time, or have something
    special than just a local_irq_enable(), and hence fall under the
    __cpu_post_online() function when converted to this model.

    Examples: ARM (patch 26) and ia64 (patch 15)

    Unless the maintainers give a go-ahead to change them, I don't
    think it would be safe.. (I have added the Notes section to each
    patch to get the attention of the maintainers to such issues).

    Regards,
    Srivatsa S. Bhat

    >
    >> + /* Enable local interrupts now */
    >> + local_irq_enable();
    >> +
    >> + wmb();
    >> + cpu_idle();
    >> +
    >> + /* We should never reach here! */
    >> + BUG();
    >> +}




    \
     
     \ /
      Last update: 2012-06-03 14:21    [W:2.766 / U:0.424 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site