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

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 20 09:43:57 PDT 2020


aganea updated this revision to Diff 258765.
aganea edited the summary of this revision.
aganea added a comment.
Herald added a reviewer: JDevlieghere.

In D78408#1990302 <https://reviews.llvm.org/D78408#1990302>, @MaskRay wrote:

> I think we should respect ThreadsRequested if it is greater than 0.


Nothing is changed in that regard. Only when `.Limit` is set.

In D78408#1990302 <https://reviews.llvm.org/D78408#1990302>, @MaskRay wrote:

> For the particular llvm-cov issue, we can probably restore the previous behavior:


I cannot restore the code exactly how it was before because of the reasons mentioned in rG8404aeb5 <https://reviews.llvm.org/rG8404aeb56a73ab24f9b295111de3b37a37f0b841>.
I rewrote it in a way which is simpler to understand. I also fixed the other places that suffered from the same issue.

A better fix could be to lazily create threads in the `ThreadPool` when jobs are pushed through `async()`. This issue here is that we are currently creating too many threads by default, whereas before we were limiting to one thread per input, given a small num.inputs .


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

https://reviews.llvm.org/D78408

Files:
  llvm/include/llvm/Support/Threading.h
  llvm/lib/Support/Threading.cpp
  llvm/tools/dsymutil/dsymutil.cpp
  llvm/tools/llvm-cov/CodeCoverage.cpp
  llvm/tools/llvm-cov/CoverageExporterJson.cpp
  llvm/tools/llvm-cov/CoverageReport.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78408.258765.patch
Type: text/x-patch
Size: 5866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200420/df11e4e8/attachment.bin>


More information about the llvm-commits mailing list