The following reply was made to PR kern/57816; it has been noted by GNATS.
From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: kern/57816: Add sysctl support for physical cores
Date: Thu, 4 Jan 2024 16:03:54 -0000 (UTC)
jtocino%gmx.com@localhost writes:
>Darwin reports actual cores as hw.physicalcpu, and FreeBSD as kern.smp.cores. Both report hyperthreads for hw.ncpy, compatible with NetBSD.
That information is currently available using the cpuctl identify command,
but it's machine specific and probably delivers the information directly
only for x86.
For testing I had added sysctls to dump the cpu information in a machine
independent way, e.g.:
% sysctl kern.cpu
kern.cpu.cpu0.package = 0
kern.cpu.cpu0.core = 0
kern.cpu.cpu0.smt = 0
kern.cpu.cpu1.package = 0
kern.cpu.cpu1.core = 0
kern.cpu.cpu1.smt = 1
kern.cpu.cpu2.package = 0
kern.cpu.cpu2.core = 1
kern.cpu.cpu2.smt = 0
kern.cpu.cpu3.package = 0
kern.cpu.cpu3.core = 1
kern.cpu.cpu3.smt = 1
But that's not very useful on machines with many CPUs, it also
misses newer information about the topology (caches, numa, big.little, ...).