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 21:36:04 -0000 (UTC)
jtocino%gmx.com@localhost (Jason Bacon) writes:
>I think it would be useful to have another variable for the number of
>physical cores. It could produce the same value as hw.ncpu on most
>architectures, which don't have hyperthreading.
>Or, if there were a boolean to indicate whether hyperthreading is active
>(which would always be 0 on most architectures), it would be simple
>enough to divide hw.ncpu by 2.
There are forms of "hyperthreading" where you have more than one
thread per core and with recent CPU designs, you can even have
different thread counts on each core.
A simple 'physical core count' isn't sufficient for anything.