From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 12:23:18 2014 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 ESMTPS id 9F118D2F for ; Mon, 4 Aug 2014 12:23:18 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:214:c2ff:fe64:b2d3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8100C24EE for ; Mon, 4 Aug 2014 12:23:18 +0000 (UTC) Received: from [IPv6:2001:470:1f07:93:225:90ff:fef4:eb0a] (unknown [IPv6:2001:470:1f07:93:225:90ff:fef4:eb0a]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: ryao) by smtp.gentoo.org (Postfix) with ESMTPSA id 27E7233FD1B; Mon, 4 Aug 2014 12:23:17 +0000 (UTC) Message-ID: <53E023EC.7010001@gentoo.org> Date: Mon, 04 Aug 2014 20:23:08 -0400 From: Richard Yao User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Stefan Parvu Subject: Re: sysctl hw add nphyscpu variable References: <20140804145342.2306d7681f0b852908dd4865@systemdatarecorder.org> In-Reply-To: <20140804145342.2306d7681f0b852908dd4865@systemdatarecorder.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0ex8UDXPAht3R2wKhPqQFTg0F2kMcaOVu" Cc: freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Aug 2014 12:23:18 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0ex8UDXPAht3R2wKhPqQFTg0F2kMcaOVu Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon 04 Aug 2014 07:53:42 AM EDT, Stefan Parvu wrote: > Hi, > > Would be possible to have under sysctl interface a new variable which w= ill track the > number of physical CPU sockets a system has ? Would be useful for hardw= are > and data inventory. It should be. > Something like: > > hw.machine: amd64 > hw.model: Intel(R) Xeon(R) CPU E5-2640 v2 @ 2.00GHz > hw.ncpu: 32 > hw.nphyscpu: 2 > ^^^^^^^^^^^^ I think hw.nsocket would make more sense. Whoever does this should=20 check to see if any other UNIX platforms have picked a suitable name. > This is an example from my system with two 2 physical CPUs installed. N= o system > virtualization in place, like Xen, etc ... > > Or is it possible currently to get easily this information ? I havent f= ound one > except dmesg information. > > FreeBSD/SMP: Multiprocessor System Detected: 32 CPUs > FreeBSD/SMP: 2 package(s) x 8 core(s) x 2 SMT threads > cpu0 (BSP): APIC ID: 0 > cpu1 (AP): APIC ID: 1 > cpu2 (AP): APIC ID: 2 > cpu3 (AP): APIC ID: 3 > cpu4 (AP): APIC ID: 4 > cpu5 (AP): APIC ID: 5 > cpu6 (AP): APIC ID: 6 > cpu7 (AP): APIC ID: 7 > cpu8 (AP): APIC ID: 8 > cpu9 (AP): APIC ID: 9 > cpu10 (AP): APIC ID: 10 > cpu11 (AP): APIC ID: 11 > cpu12 (AP): APIC ID: 12 > cpu13 (AP): APIC ID: 13 > cpu14 (AP): APIC ID: 14 > cpu15 (AP): APIC ID: 15 > cpu16 (AP): APIC ID: 32 > cpu17 (AP): APIC ID: 33 > cpu18 (AP): APIC ID: 34 > cpu19 (AP): APIC ID: 35 > cpu20 (AP): APIC ID: 36 > cpu21 (AP): APIC ID: 37 > cpu22 (AP): APIC ID: 38 > cpu23 (AP): APIC ID: 39 > cpu24 (AP): APIC ID: 40 > cpu25 (AP): APIC ID: 41 > cpu26 (AP): APIC ID: 42 > cpu27 (AP): APIC ID: 43 > cpu28 (AP): APIC ID: 44 > cpu29 (AP): APIC ID: 45 > cpu30 (AP): APIC ID: 46 > cpu31 (AP): APIC ID: 47 Whoever implements this would want to find the code that prints this=20 and use the information to initialize the sysctl variable. > Probable things will get complicated a bit if the system is a guest und= er Xen or other > hypervisor. But probable there the nphyscpu should be NA ? The hypervisor is able to pass through a geometry, so this would still=20 make sense there. --0ex8UDXPAht3R2wKhPqQFTg0F2kMcaOVu 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 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJT4CPyAAoJECDuEZm+6ExkQKUP/0jK/02jOFBk0Ax3qF5ObuNF 3gd2LcWXB0TAXc2pthPthTrN8L3NunWXbJ1CzZhrFvsb0OMRAthh4t818T+7E4Ik n/jhvMf+GMT7YOueRTriCOojRiP88MWizT17ugdMxibQuqdl0uicsCCyBE8pcYPe sekdQjJFc33xjIvkMEGe8oVTP+vK461Xv64HUq8Gy2kQEEwlTZSVBNx+xVx84Cus JkpGlP56HCltWZcA83IttHQL09ylsK9z6e9AHBl/aGHttmkwyBv4kSwQ8MJc+ock 8xzQN8jQoDPgaHEo+QwvbmH2XvJyC6TAYDmohue1qca00yu8/nfXypcHBdFMsZk0 ad3FrN3URV8uLBTD9aC+0SNUs04dHBPALU+qCXv2ZXzTJMTea/T/yx+RK6s9zUXW reI1nwrJVLWpiz7R3DD9BBQ/Vunz/BNRRHmSgpxVu5En6Qx97bjsRh1CEnBh+TcP 0VDTqN/owFOAIktFnKveJur3srjTXjkrCokNwGVFX1PWYJ3v85mXmj0PtCpCY6Sr EKsqJ8TMyG65wA0X6dXkT3kdUXp0zn0YwMmP5J8gS1XtPdLCHL+brrXjeX/GSpjZ Ta3ta0gr1MZ6byfAvW/XwtbLGNr3AwOsNB96XRbZ09DxGV+O0ayk9r4/3TZeSL/Y 6JrK1AEns92g3BvbvQwf =J9jx -----END PGP SIGNATURE----- --0ex8UDXPAht3R2wKhPqQFTg0F2kMcaOVu--