From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 4 11:53:57 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 2613CF63 for ; Mon, 4 Aug 2014 11:53:57 +0000 (UTC) Received: from systemdatarecorder.org (mail.systemdatarecorder.org [54.246.96.61]) (using TLSv1.1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "localhost" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B9EB62001 for ; Mon, 4 Aug 2014 11:53:56 +0000 (UTC) Received: from nereid (188-127-209-196.cust.suomicom.net [188.127.209.196]) (authenticated bits=0) by systemdatarecorder.org (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id s74BpWEc028150 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 4 Aug 2014 11:51:32 GMT Date: Mon, 4 Aug 2014 14:53:42 +0300 From: Stefan Parvu To: freebsd-hackers@freebsd.org Subject: sysctl hw add nphyscpu variable Message-Id: <20140804145342.2306d7681f0b852908dd4865@systemdatarecorder.org> Organization: systemdatarecorder.org X-Mailer: Sylpheed 3.4.2 (GTK+ 2.24.22; amd64-portbld-freebsd11.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 11:53:57 -0000 Hi, Would be possible to have under sysctl interface a new variable which will track the number of physical CPU sockets a system has ? Would be useful for hardware and data inventory. Something like: hw.machine: amd64 hw.model: Intel(R) Xeon(R) CPU E5-2640 v2 @ 2.00GHz hw.ncpu: 32 hw.nphyscpu: 2 ^^^^^^^^^^^^ This is an example from my system with two 2 physical CPUs installed. No system virtualization in place, like Xen, etc ... Or is it possible currently to get easily this information ? I havent found 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 Probable things will get complicated a bit if the system is a guest under Xen or other hypervisor. But probable there the nphyscpu should be NA ? -- Stefan Parvu