[PATCH] D76240: [Sanitizers][Test] If the default linker is LLD, disable threads
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 17 04:27:47 PDT 2020
nemanjai added a comment.
In D76240#1925419 <https://reviews.llvm.org/D76240#1925419>, @efriedma wrote:
> "overwhelmed" by what, exactly? I mean, I guess there's fundamentally some overhead if we end up with N^2 active threads (where N is the number of cores), but threads don't have that much memory overhead on their own; it shouldn't be high in absolute terms unless your test machine somehow has hundreds of cores. And I'm not sure what else could cause an issue; I guess if the kernel scheduler decided to do something weird, context switches might hurt performance?
>
> Also, what OS are you using?
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.6 LTS"
$ lscpu
Architecture: ppc64le
Byte Order: Little Endian
CPU(s): 192
The errors reported by the system is that it is unable to spawn any more threads because the resource is unavailable. This hardly seems unique to my machine. I imagine most machines with hyperthreading and large core counts will be in a similar situation.
BTW. I am not even convinced that the number of threads is `n^2` in the number of CPU's. I didn't really dig into the implementation of the parallel support library, but the following comment in `include/llvm/Support/Parallel.h` certainly seems a bit concerning:
// TaskGroup has a relatively high overhead, so we want to reduce
// the number of spawn() calls. We'll create up to 1024 tasks here.
// (Note that 1024 is an arbitrary number. This code probably needs
// improving to take the number of available cores into account.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76240/new/
https://reviews.llvm.org/D76240
More information about the llvm-commits
mailing list