From owner-svn-src-all@FreeBSD.ORG Wed Apr 22 22:21:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC6681065673; Wed, 22 Apr 2009 22:21:45 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from scuttle.submonkey.net (scuttle.submonkey.net [208.111.43.184]) by mx1.freebsd.org (Postfix) with ESMTP id C98A48FC1F; Wed, 22 Apr 2009 22:21:45 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from cpc1-cdif1-0-0-cust63.cdif.cable.ntl.com ([81.104.164.64] helo=shrike.submonkey.net) by scuttle.submonkey.net with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1LwkX5-0004lx-5c; Wed, 22 Apr 2009 22:03:07 +0000 Received: from ceri by shrike.submonkey.net with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LwkX3-000M1V-1X; Wed, 22 Apr 2009 23:03:05 +0100 Date: Wed, 22 Apr 2009 23:03:04 +0100 From: Ceri Davies To: John Baldwin Message-ID: <20090422220304.GB54875@submonkey.net> References: <200904222140.n3MLebn3068260@svn.freebsd.org> <200904221759.04446.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: <200904221759.04446.jhb@freebsd.org> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.18 (2008-05-17) Sender: Ceri Davies 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2009 22:21:46 -0000 --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 22, 2009 at 05:59:04PM -0400, John Baldwin wrote: > 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 > >=20 > > Log: > > Adjust the way we number CPUs on x86 so that we attempt to "group" all > > logical CPUs in a package. We do this by numbering the non-boot CPUs > > by starting with the first CPU whose APIC ID is after the boot CPU and > > wrapping back around to APIC ID 0 if needed rather than always starti= ng > > at APIC ID 0. While here, adjust the cpu_mp_announce() routine to li= st > > CPUs based on the mapping established by assign_cpu_ids() rather than > > making assumptions about the algorithm assign_cpu_ids() uses. >=20 > An example is probably in order for this to make sense. Suppose you have= a=20 > system with two quad-core CPUs. Package 0 has CPUs numbered 0, 1, 2, and= 3. =20 > Package 1 has CPUs numbered 4, 5, 6, and 7. With the old code, if packag= e 0=20 > won the election to be the boot processor, then CPU 0 would be the BSP an= d=20 > the logical IDs would match the APIC IDs. However, if package 1 won the= =20 > election during POST, then CPU 0 would be APIC ID 4 on package 0 followed= by=20 > CPU 1 being APIC ID 0, CPU 2 being APIC ID 1, etc. Thus, when CPU 0 was = the=20 > boot CPU you had a nice grouping where CPUs 0-3 were a single package and= =20 > CPUs 4-7 were another package. However, when CPU 4 was the boot CPU, CPU= s 0=20 > and 5-7 where one package, and CPUs 1-4 where the second package. The ef= fect=20 > of this patch is to change the case when CPU 4 is the boot CPU such that = CPUs=20 > 0-3 are now all from CPU 4's package (APIC IDs 4-7), and CPUs 4-7 are fro= m=20 > the other package (APIC IDs 0-3). What this means, in turn, is that in b= oth=20 > cases you now always have CPUs 0-3 as one package and CPUs 4-7 as another= =20 > package regardless of which CPU wins the boot-time election. What if I have HT turned on? Do they bunch up with the "real" CPU IDs or all together at the end? Ceri --=20 That must be wonderful! I don't understand it at all. -- Moliere --G4iJoqBmSsgzjUCe Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFJ75QYocfcwTS3JF8RAj4hAKC6hCKSn53TlPljqDR/w/PAPxRyxACdE7g8 woYCJRMhkvG1mVEJ2tMfF7Q= =YGP1 -----END PGP SIGNATURE----- --G4iJoqBmSsgzjUCe--