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
[-- Attachment #1 --]
On 23/08/2013 15:23, Dmitry Sivachenko wrote:
> Hello!
>
> I am using FreeBSD-9-STABLE on the following hardware:
>
> FreeBSD/SMP: Multiprocessor System Detected: 24 CPUs
> FreeBSD/SMP: 2 package(s) x 6 core(s) x 2 SMT threads
>
> So I have 2 physical CPUs with 6 core each.
>
> # 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
>
>
> So each of 24 cores are numbered 0..23.
>
> 1) In what particular order are these cores numbered? Can I assume that 0..11 correspond to 1st physical CPU and 12..23 to second? How SMT threads are numbered within each core?
You could look at the kern.sched.topology_spec sysctl, which outputs
like this:
<groups>
<group level="1" cache-level="0">
<cpu count="8" mask="ff">0, 1, 2, 3, 4, 5, 6, 7</cpu>
<children>
<group level="2" cache-level="2">
<cpu count="4" mask="f">0, 1, 2, 3</cpu>
</group>
<group level="2" cache-level="2">
<cpu count="4" mask="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).
[-- Attachment #2 --]
-----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-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?kvfev7$e0r$1>
