On 1/4/24 08:52, Martin Husemann wrote:
On Thu, Jan 04, 2024 at 08:13:57AM -0600, Jason Bacon wrote:Does anyone know how to get the number of complete cores on a hyperthreaded CPU under NetBSD? On FreeBSD it's sysctl kern.smp.cores. On Darwin it's sysctl hw.physicalcpu. I'm not seeing an equivalent on NetBSD. hw.ncpu reports total hyperthreads, as it does on the other platforms.There is no easily accessible value for this in NetBSD currently. We should probably follow FreeBSD. Are there other interesting values in hw.smp? Martin
FreeBSD coral.acadix bacon ~ 1020: 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 Is there a way to detect whether hyperthreading is enabled? If we have that, we can divide hw.ncpu by 2. If not, using hw.ncpu is not a catastrophe. I just means NetBSD cores will be somewhat oversubscribed by default.