From owner-freebsd-current@FreeBSD.ORG Wed Apr 6 12:45:13 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9DCC106566C for ; Wed, 6 Apr 2011 12:45:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B3B858FC12 for ; Wed, 6 Apr 2011 12:45:13 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4FF3346B38; Wed, 6 Apr 2011 08:45:13 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D9B448A02A; Wed, 6 Apr 2011 08:45:12 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Wed, 6 Apr 2011 08:36:56 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104060836.56542.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 06 Apr 2011 08:45:12 -0400 (EDT) Cc: Ryan Stone Subject: Re: sched_4bsd startup crash trying to run a bound thread on an AP that hasn't started X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2011 12:45:13 -0000 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