Would it be possible to modify the descriptions of /usr/src/sys/kern/subr_smp.c to more accurately reflect the meaning of the sysctls. As a suggestion on line 99 to read "Number of logical CPUs online" and line 107 to read "Number of physical CPUs online" per: Line 99 int smp_cpus = 1; /* how many cpu's running */ SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_cpus, 0, "Number of CPUs online"); Line 107 int mp_ncores = -1; /* how many physical cores running */ SYSCTL_INT(_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncores, 0, "Number of CPUs online"); :) I'll leave hw.ncpu for another day ;)
Would you be fine with "Number of physical cores online" ?
(In reply to Konstantin Belousov from comment #1) Thanks for taking a look, and I'd be happy with any improvement. Though... for folks that have been around awhile, core used to be those little magnetic loops around a couple of wires ;) Happy with Number of physical cores online for line 107, as it makes the distinction. Though I wonder if the younger contributors would appreciate the subtle distinction between core and cpu. As I reflect upon the interpretations of others, perhaps for line 99 Number of hyperthreaded CPUs online would provide greater clarity? Kind regards, Dewayne.
(In reply to dewayne from comment #2) Term hyperthreading has very narrow meaning, it is only applicable to Intel' CPUs. FreeBSD systematically uses term CPU as an execution agent that has independent ISA state. RISC-V calls them harts. Core is the single execution engine that can provide several OS-visible CPUs, where CPUs share some execution resources, and which cannot be 'split' into smaller chips. At least this is the terminology of CPU vendors. Sysctls descriptions should not be an educational resource.
A commit references this bug: Author: kib Date: Mon Aug 3 17:17:17 UTC 2020 New revision: 363801 URL: https://svnweb.freebsd.org/changeset/base/363801 Log: Provide more correct description for sysctl kern.smp.cores. Reported by: dewayne@heuristicsystems.com.au PR: 248454 Sponsored by: The FreeBSD Foundation MFC after: 3 days Changes: head/sys/kern/subr_smp.c
A commit references this bug: Author: kib Date: Thu Aug 6 10:12:39 UTC 2020 New revision: 363947 URL: https://svnweb.freebsd.org/changeset/base/363947 Log: MFC r248454: Provide more correct description for sysctl kern.smp.cores. PR: 248454 Changes: _U stable/12/ stable/12/sys/kern/subr_smp.c
^Triage: Assign to committer that resolved, track merges and close