Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Aug 2014 14:53:42 +0300
From:      Stefan Parvu <sparvu@systemdatarecorder.org>
To:        freebsd-hackers@freebsd.org
Subject:   sysctl hw add nphyscpu variable
Message-ID:  <20140804145342.2306d7681f0b852908dd4865@systemdatarecorder.org>

next in thread | raw e-mail | index | archive | help
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 <sparvu@systemdatarecorder.org>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140804145342.2306d7681f0b852908dd4865>