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: Wed, 6 Apr 2011 08:36:56 -0400
On Monday, April 04, 2011 5:10:20 pm Ryan Stone wrote:
> I'm running into a bootup crash under sched_4bsd on HEAD.  The crash
> happens when I have a thread bound to a single CPU that isn't the BSP,
> and that thread is scheduled.  If the AP that the thread is bound
> hasn't been started up, kick_other_cpu() crashes because
> pcpu->pc_curthread is NULL for the AP.
> 
> I've put a small test kld in
> http://people.freebsd.org/~rstone/4bsd_bind/ that reproduces the
> problem.  I'm not sure what the best way to address the crash is.  ULE
> is not affected by the problem; it seems to run the swi thread on CPU
> 0 until CPU 1 is running.

Hummm.  Patching 4BSD to use the same route as ULE may be the best solution 
for now if that is easiest.  Alternatively, you could change 4BSD's 
sched_add() to not try to kick other CPUs until smp_started is true.

-- 
John Baldwin
Received on Wed Apr 06 2011 - 10:45:13 UTC

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