[PATCH] D78408: [llvm-cov] Prevent llvm-cov from using too many threads

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 10:16:50 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/lib/Support/Threading.cpp:88
   int MaxThreadCount = UseHyperThreads ? computeHostNumHardwareThreads()
                                        : sys::getHostNumPhysicalCores();
   if (MaxThreadCount <= 0)
----------------
Note that `sys::getHostNumPhysicalCores` can return -1 in some cases (on some OS/arch). In such cases we will return `1` if `ThreadsRequested == 0`.

I still think that if the user asks for more threads than the CPU supports, we should respect that. For one thing, not every task can fully leverage 100% of the computing power of a core.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78408/new/

https://reviews.llvm.org/D78408





More information about the llvm-commits mailing list