Re: [PATCH v3 1/5] x86: initialize secondary CPU only if master CPU will wait for it

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 14 Apr 2014 12:03:35 +0200
Ingo Molnar <mingo@xxxxxxxxxx> wrote:

> 
> * Igor Mammedov <imammedo@xxxxxxxxxx> wrote:
> 
> > On Mon, 14 Apr 2014 11:16:00 +0200
> > Ingo Molnar <mingo@xxxxxxxxxx> wrote:
> > 
> > > 
> > > * Igor Mammedov <imammedo@xxxxxxxxxx> wrote:
> > > 
> > > >  	/*
> > > > +	 * wait for ACK from master CPU before continuing
> > > > +	 * with AP initialization
> > > > +	 */
> > > > +	cpumask_set_cpu(cpu, cpu_initialized_mask);
> > > > +	while (!cpumask_test_cpu(cpu, cpu_callout_mask))
> > > > +		cpu_relax();
> > > 
> > > > +	/*
> > > > +	 * wait for ACK from master CPU before continuing
> > > > +	 * with AP initialization
> > > > +	 */
> > > > +	cpumask_set_cpu(cpu, cpu_initialized_mask);
> > > > +	while (!cpumask_test_cpu(cpu, cpu_callout_mask))
> > > > +		cpu_relax();
> > > 
> > > That repetitive pattern could be stuck into a properly named helper 
> > > inline function.
> > sure
> > 
> > > (Also, before the cpumask_set_cpu() we should probably do a WARN_ON() 
> > > if the bit is already set.)
WARN_ON will never be triggered here since bit is always cleared by master
CPU before AP gets here. There is no harm keeping WARN_ON though,
do you still want it be here?

It could be useful to put WARN_ON in do_boot_cpu() before bit is cleared,
so that user would see that he tries to online AP which has failed
previous time. It's not really necessary since failed to online attempt
reported in logs at ERR level now, see patch 2/5.

Thanks,
   Igor

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux