From owner-freebsd-current@FreeBSD.ORG Tue Apr 26 20:16:29 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 38A061065670 for ; Tue, 26 Apr 2011 20:16:29 +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 0BC5B8FC13 for ; Tue, 26 Apr 2011 20:16:29 +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 8345046B43; Tue, 26 Apr 2011 16:16:28 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 02C858A01B; Tue, 26 Apr 2011 16:16:28 -0400 (EDT) From: John Baldwin To: Ryan Stone Date: Tue, 26 Apr 2011 15:54:56 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201104251458.35718.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104261554.56218.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 26 Apr 2011 16:16:28 -0400 (EDT) Cc: freebsd-current@freebsd.org 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: Tue, 26 Apr 2011 20:16:29 -0000 On Tuesday, April 26, 2011 3:46:06 pm Ryan Stone wrote: > On Mon, Apr 25, 2011 at 2:58 PM, John Baldwin 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