From owner-svn-src-head@FreeBSD.ORG Thu Apr 23 20:05:22 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 241551065773; Thu, 23 Apr 2009 20:05:22 +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 E8C548FC13; Thu, 23 Apr 2009 20:05:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 4870546B5B; Thu, 23 Apr 2009 16:05:21 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id E9D0B8A01B; Thu, 23 Apr 2009 16:05:19 -0400 (EDT) From: John Baldwin To: Ivan Voras Date: Thu, 23 Apr 2009 09:55:59 -0400 User-Agent: KMail/1.9.7 References: <200904222140.n3MLebn3068260@svn.freebsd.org> <200904221759.04446.jhb@freebsd.org> <9bbcef730904221530u786464d3v2dc05b0bb2f1218a@mail.gmail.com> In-Reply-To: <9bbcef730904221530u786464d3v2dc05b0bb2f1218a@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200904230955.59850.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Thu, 23 Apr 2009 16:05:20 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=1.1 required=4.2 tests=AWL,DATE_IN_PAST_06_12, RDNS_NONE autolearn=no version=3.2.5 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r191405 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Apr 2009 20:05:22 -0000 On Wednesday 22 April 2009 6:30:12 pm Ivan Voras wrote: > 2009/4/22 John Baldwin : > > On Wednesday 22 April 2009 5:40:37 pm John Baldwin wrote: > >> Author: jhb > >> Date: Wed Apr 22 21:40:37 2009 > >> New Revision: 191405 > >> URL: http://svn.freebsd.org/changeset/base/191405 > >> > >> Log: > >> =C2=A0 Adjust the way we number CPUs on x86 so that we attempt to "gro= up" all > >> =C2=A0 logical CPUs in a package. =C2=A0We do this by numbering the no= n-boot CPUs > >> =C2=A0 by starting with the first CPU whose APIC ID is after the boot = CPU and > >> =C2=A0 wrapping back around to APIC ID 0 if needed rather than always = starting > >> =C2=A0 at APIC ID 0. =C2=A0While here, adjust the cpu_mp_announce() ro= utine to list > >> =C2=A0 CPUs based on the mapping established by assign_cpu_ids() rathe= r than > >> =C2=A0 making assumptions about the algorithm assign_cpu_ids() uses. > > > > An example is probably in order for this to make sense. =C2=A0Suppose y= ou have a > > system with two quad-core CPUs. =C2=A0Package 0 has CPUs numbered 0, 1,= 2, and 3. > > Package 1 has CPUs numbered 4, 5, 6, and 7. =C2=A0With the old code, if= package 0 > > won the election to be the boot processor, then CPU 0 would be the BSP = and > > the logical IDs would match the APIC IDs. =C2=A0However, if package 1 w= on the > > election during POST, then CPU 0 would be APIC ID 4 on package 0 follow= ed by > > CPU 1 being APIC ID 0, CPU 2 being APIC ID 1, etc. =C2=A0Thus, when CPU= 0 was the > > boot CPU you had a nice grouping where CPUs 0-3 were a single package a= nd > > CPUs 4-7 were another package. =C2=A0However, when CPU 4 was the boot C= PU, CPUs 0 > > and 5-7 where one package, and CPUs 1-4 where the second package. =C2= =A0The effect > > of this patch is to change the case when CPU 4 is the boot CPU such tha= t CPUs > > 0-3 are now all from CPU 4's package (APIC IDs 4-7), and CPUs 4-7 are f= rom > > the other package (APIC IDs 0-3). =C2=A0What this means, in turn, is th= at in both > > cases you now always have CPUs 0-3 as one package and CPUs 4-7 as anoth= er > > package regardless of which CPU wins the boot-time election. >=20 > I like that the new numbering is more elegant, but this is orthogonal > to ULE topology detection, right? Yes. =2D-=20 John Baldwin