summaryrefslogtreecommitdiff
path: root/compiler-rt/unittests
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2017-01-20 00:25:01 +0000
committerKuba Mracek <mracek@apple.com>2017-01-20 00:25:01 +0000
commit245318cb0501a417c5cda39dd00e31f133f12d87 (patch)
tree923661ba3c7abffd7bedff99ba636f41297fc0e3 /compiler-rt/unittests
parent30881272e1c81467703f1e4a7a4edde8544f7058 (diff)
downloadllvm-245318cb0501a417c5cda39dd00e31f133f12d87.tar.gz
[lit] Limit parallelism of sanitizer tests on Darwin [compiler-rt part, take 2]
Running lit tests and unit tests of ASan and TSan on macOS has very bad performance when running with a high number of threads. This is caused by xnu (the macOS kernel), which currently doesn't handle mapping and unmapping of sanitizer shadow regions (reserved VM which are several terabytes large) very well. The situation is so bad that increasing the number of threads actually makes the total testing time larger. The macOS buildbots are affected by this. Note that we can't easily limit the number of sanitizer testing threads without affecting the rest of the tests. This patch adds a special "group" into lit, and limits the number of concurrently running tests in this group. This helps solve the contention problem, while still allowing other tests to run in full, that means running lit with -j8 will still with 8 threads, and parallelism is only limited in sanitizer tests. Differential Revision: https://reviews.llvm.org/D28420 llvm-svn: 292549
Diffstat (limited to 'compiler-rt/unittests')
-rw-r--r--compiler-rt/unittests/lit.common.unit.cfg10
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler-rt/unittests/lit.common.unit.cfg b/compiler-rt/unittests/lit.common.unit.cfg
index 2bd8f376f00e..475b22d41ce6 100644
--- a/compiler-rt/unittests/lit.common.unit.cfg
+++ b/compiler-rt/unittests/lit.common.unit.cfg
@@ -28,3 +28,13 @@ if 'TMP' in os.environ:
config.environment['TMP'] = os.environ['TMP']
if 'TEMP' in os.environ:
config.environment['TEMP'] = os.environ['TEMP']
+
+if config.host_os == 'Darwin':
+ # Only run up to 3 64-bit sanitized processes simultaneously on Darwin.
+ # Using more scales badly and hogs the system due to inefficient handling
+ # of large mmap'd regions (terabytes) by the kernel.
+ lit_config.parallelism_groups["darwin-64bit-sanitizer"] = 3
+
+ def darwin_sanitizer_parallelism_group_func(test):
+ return "darwin-64bit-sanitizer" if "x86_64" in test.file_path else ""
+ config.darwin_sanitizer_parallelism_group_func = darwin_sanitizer_parallelism_group_func