NetBSD-Bugs archive

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

Re: kern/57816: Add sysctl support for physical cores



On 1/4/24 15:40, Michael van Elst wrote:
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.


A simple core count is sufficient for preventing oversubscription of
cores, in order to maximize the speed of individual threads by
eliminating a major source of contention.  This is the goal of most HPC
resource managers, and of the py-joblib developers, which triggered this
discussion (adding BSD support for auto-detection of available cores).


Home | Main Index | Thread Index | Old Index