]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Merge commit d989ffd10 from llvm git (by Dimitry Andric):
authorDimitry Andric <dim@FreeBSD.org>
Thu, 3 Dec 2020 19:29:18 +0000 (19:29 +0000)
committerDimitry Andric <dim@FreeBSD.org>
Thu, 3 Dec 2020 19:29:18 +0000 (19:29 +0000)
commitc3f7be36e8ad24c31a3c56851681803704a4b0b2
tree9f071d17c2c9690b5373b8e8895646cbdd149f1e
parent5cc6cb2645b79b6108922957984dd86077cd7f06
Merge commit d989ffd10 from llvm git (by Dimitry Andric):

  Implement computeHostNumHardwareThreads() for FreeBSD

  This retrieves CPU affinity via FreeBSD's cpuset(2) API, and makes
  LLVM respect affinity settings configured by the user via the
  cpuset(1) command.

  In particular, this allows to reduce the number of threads used on
  machines with high core counts, which can interact badly with
  parallelized build systems. This is particularly noticable with lld,
  which spawns lots of threads even for linking e.g. hello_world!

  This fix is related to PR48193, but does not adress the more
  fundamental problem, which is that LLVM by default grabs as many CPUs
  and/or threads as possible.

  Reviewed By: MaskRay

  Differential Revision: https://reviews.llvm.org/D92271

Originally by: mjg
MFC after: 1 week
contrib/llvm-project/llvm/lib/Support/Unix/Threading.inc