Re: [patch 1/4] x86, mtrr: lock stop machine during MTRR rendezvoussequence

From: Thomas Gleixner
Date: Thu Jun 23 2011 - 05:33:40 EST


On Thu, 23 Jun 2011, Peter Zijlstra wrote:

> On Wed, 2011-06-22 at 15:20 -0700, Suresh Siddha wrote:
> > +#ifdef CONFIG_SMP
> > + /*
> > + * If we are not yet online, then there can be no stop_machine() in
> > + * parallel. Stop machine ensures this by using get_online_cpus().
> > + *
> > + * If we are online, then we need to prevent a stop_machine() happening
> > + * in parallel by taking the stop cpus mutex.
> > + */
> > + if (cpu_online(raw_smp_processor_id()))
> > + mutex_lock(&stop_cpus_mutex);
> > +#endif
>
> This reads like an optimization, is it really worth-while to not take
> the mutex in the rare offline case?

You cannot block on a mutex when you are not online, in fact you
cannot block on it when not active, so the check is wrong anyway.

Thanks,

tglx


--
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/