]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Merge commit d989ffd10 from llvm git (by Dimitry Andric):
authordim <dim@FreeBSD.org>
Thu, 3 Dec 2020 19:29:18 +0000 (19:29 +0000)
committerdim <dim@FreeBSD.org>
Thu, 3 Dec 2020 19:29:18 +0000 (19:29 +0000)
commit8d2843715bafa4fa556c9f4b0211b9b85748efde
tree9f071d17c2c9690b5373b8e8895646cbdd149f1e
parent60e2665c4f3ce1930f40048830565ff123463c29
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