From owner-freebsd-current@FreeBSD.ORG Sat Sep 29 04:57:37 2007 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 1836516A420 for ; Sat, 29 Sep 2007 04:57:37 +0000 (UTC) (envelope-from freebsd@bitfreak.org) Received: from mail.twinthornes.com (mail.twinthornes.com [65.75.198.147]) by mx1.freebsd.org (Postfix) with ESMTP id E490A13C47E for ; Sat, 29 Sep 2007 04:57:36 +0000 (UTC) (envelope-from freebsd@bitfreak.org) Received: from [10.9.70.100] (pool-71-117-232-141.ptldor.fios.verizon.net [71.117.232.141]) by mail.twinthornes.com (Postfix) with ESMTP id B9B088A for ; Fri, 28 Sep 2007 21:25:11 -0700 (PDT) Message-ID: <46FDD3AB.3050305@bitfreak.org> Date: Fri, 28 Sep 2007 21:25:15 -0700 From: Darren Pilgrim User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <46FCB7B7.9010301@FreeBSD.org> <20070928083322.GA17225@eos.sc1.parodius.com> <46FD1631.9020708@evilphi.com> <20070928184659.GB57646@cicely12.cicely.de> In-Reply-To: <20070928184659.GB57646@cicely12.cicely.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Non-sequential AP starts [Was: Re: 8-core server] 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: Sat, 29 Sep 2007 04:57:37 -0000 Bernd Walter wrote: > On Fri, Sep 28, 2007 at 07:56:49AM -0700, Darren Pilgrim wrote: >> Jeremy Chadwick wrote: >>> I think what you're not noticing is that the cores are being launched in >>> non-sequential order. 1, 2, 3, 4, 7, 5, 6. This isn't a problem. >> Why they wouldn't be launched sequentially? > > First SMP rule: > Don't expect a specific execution order from things running parallel. > > I don't know the code, but would assume that they are started > sequentially and each core prints it's own line, so they get > disordered. This question bugged me long enough for me to go read some source to find the answer, but I ended up with more questions. I guess that's what I get for reading boot code. :) I know it's basically just a race condition, but where does the race actually occur? In each core's execution of startup instructions leading up to the printf() in init_secondary() or in the assignment of the value returned by PCPU_GET(cpudid)? Where is the data behind PCPU_GET() anyway? I couldn't find it. Is AP launch order random or are there CPU characteristics that result in reproducible non-sequential ordering?