Re: sched_4bsd startup crash trying to run a bound thread on an AP that hasn't started

From: John Baldwin <jhb_at_freebsd.org>
Date: Tue, 26 Apr 2011 15:54:56 -0400
On Tuesday, April 26, 2011 3:46:06 pm Ryan Stone wrote:
> On Mon, Apr 25, 2011 at 2:58 PM, John Baldwin <jhb_at_freebsd.org> wrote:
> >
> > Yes, I would perhaps tweak the comment to reflect the full if statement
> > though.  Maybe something like:
> >
> > /*
> >  * If SMP is started and the thread is pinned or otherwise limited to
> >  * a specific set of CPUs, queue the thread to a per-CPU run queue.
> >  * Otherwise, queue the thread to the global run queue.
> >  */
> 
> That looks fine, but I'm going to add a sentence explaining why the
> smp_started condition is necessary:
> 
> /*
>  * If SMP is started and the thread is pinned or otherwise limited to
>  * a specific set of CPUs, queue the thread to a per-CPU run queue.
>  * Otherwise, queue the thread to the global run queue.
>  *
>  * If SMP has not yet been started we must use the global run queue
>  * as per-CPU state may not be initialized yet and we may crash if we
>  * try to access the per-CPU run queues.
>  */

Sure, commit away.

-- 
John Baldwin
Received on Tue Apr 26 2011 - 18:16:29 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:13 UTC