From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 26 11:45:07 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 16ABC4B4 for ; Mon, 26 Aug 2013 11:45:07 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C6ADB2C7B for ; Mon, 26 Aug 2013 11:45:06 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VDvEF-0003YX-Q5 for freebsd-hackers@freebsd.org; Mon, 26 Aug 2013 13:45:03 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Aug 2013 13:45:03 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 26 Aug 2013 13:45:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Ivan Voras Subject: Re: About CPU cores numbering an processor affinity Date: Mon, 26 Aug 2013 13:42:38 +0200 Lines: 64 Message-ID: References: <1D21F5BC-63CD-4B33-9286-6687E62FDB15@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2MVIUSWNMUCBQNGBXWJED" X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130322 Thunderbird/17.0.4 In-Reply-To: <1D21F5BC-63CD-4B33-9286-6687E62FDB15@gmail.com> X-Enigmail-Version: 1.5.1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Aug 2013 11:45:07 -0000 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: 0, 1, 2, 3, 4, 5, 6, 7 0, 1, 2, 3 4, 5, 6, 7 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--