Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Aug 2013 13:42:38 +0200
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: About CPU cores numbering an processor affinity
Message-ID:  <kvfev7$e0r$1@ger.gmane.org>
In-Reply-To: <1D21F5BC-63CD-4B33-9286-6687E62FDB15@gmail.com>
References:  <1D21F5BC-63CD-4B33-9286-6687E62FDB15@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
------enig2MVIUSWNMUCBQNGBXWJED
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On 23/08/2013 15:23, Dmitry Sivachenko wrote:
> Hello!
>=20
> I am using FreeBSD-9-STABLE on the following hardware:
>=20
> FreeBSD/SMP: Multiprocessor System Detected: 24 CPUs
> FreeBSD/SMP: 2 package(s) x 6 core(s) x 2 SMT threads
>=20
> So I have 2 physical CPUs with 6 core each.
>=20
> # cpuset -g
> pid -1 mask: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, =
17, 18, 19, 20, 21, 22, 23
>=20
>=20
> So each of 24 cores are numbered 0..23.
>=20
> 1) In what particular order are these cores numbered?  Can I assume tha=
t 0..11 correspond to 1st physical CPU and 12..23 to second?  How SMT thr=
eads are numbered within each core?

You could look at the kern.sched.topology_spec sysctl, which outputs
like this:

<groups>
 <group level=3D"1" cache-level=3D"0">
  <cpu count=3D"8" mask=3D"ff">0, 1, 2, 3, 4, 5, 6, 7</cpu>
  <children>
   <group level=3D"2" cache-level=3D"2">
    <cpu count=3D"4" mask=3D"f">0, 1, 2, 3</cpu>
   </group>
   <group level=3D"2" cache-level=3D"2">
    <cpu count=3D"4" mask=3D"f0">4, 5, 6, 7</cpu>
   </group>
  </children>
 </group>
</groups>

Note that this output is created from the kernel's own interpretation of
the pysical CPUs, not necessarily from what the physical topology
actually is (but if there is a mismatch, it's a bug).



------enig2MVIUSWNMUCBQNGBXWJED
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlIbPy4ACgkQ/QjVBj3/HSw26gCfdNnHGXPHILLSCoZ2ZwXt4ef6
R+wAni0wLHPCFmfqx3fUNbCYRyhN7pRP
=3QNt
-----END PGP SIGNATURE-----

------enig2MVIUSWNMUCBQNGBXWJED--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?kvfev7$e0r$1>