NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/57816: Add sysctl support for physical cores



>Number:         57816
>Category:       kern
>Synopsis:       Add sysctl support for physical cores
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 04 15:25:00 +0000 2024
>Originator:     Jason Bacon
>Release:        9.3
>Organization:
>Environment:
NetBSD netbsd9.acadix.biz 9.3 NetBSD 9.3 (GENERIC) #0: Thu Aug  4 5:30:37 UTC 2022  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64

>Description:
NetBSD apparently lacks the ability to report physical cores, as opposed to hyperthreads (hw.ncpu reports hyperthreads).

Darwin reports actual cores as hw.physicalcpu, and FreeBSD as kern.smp.cores.  Both report hyperthreads for hw.ncpy, compatible with NetBSD.

FreeBSD coral.acadix  bacon ~ 1022: sysctl kern.smp
kern.smp.forward_signal_enabled: 1
kern.smp.topology: 0
kern.smp.cores: 2
kern.smp.threads_per_core: 2
kern.smp.cpus: 4
kern.smp.disabled: 0
kern.smp.active: 1
kern.smp.maxcpus: 256
kern.smp.maxid: 3

Darwin tarpon.local  bacon ~ 1003: (pkgsrc): sysctl hw | grep cpu
hw.ncpu: 8
hw.activecpu: 8
hw.perflevel0.physicalcpu: 4
hw.perflevel0.physicalcpu_max: 4
hw.perflevel0.logicalcpu: 4
hw.perflevel0.logicalcpu_max: 4
hw.perflevel0.cpusperl2: 4
hw.perflevel1.physicalcpu: 4
hw.perflevel1.physicalcpu_max: 4
hw.perflevel1.logicalcpu: 4
hw.perflevel1.logicalcpu_max: 4
hw.perflevel1.cpusperl2: 4
hw.physicalcpu: 8
hw.physicalcpu_max: 8
hw.logicalcpu: 8
hw.logicalcpu_max: 8
hw.cputype: 16777228
hw.cpusubtype: 2
hw.cpu64bit_capable: 1
hw.cpufamily: 458787763
hw.cpusubfamily: 2


>How-To-Repeat:
sysctl -a|grep -E 'cpu|core'
>Fix:
Add new sysctls similar to those provided by Darwin or FreeBSD.



Home | Main Index | Thread Index | Old Index