aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTCWG Buildslave <tcwg-buildslave@linaro.org>2018-12-04 00:50:18 +0000
committerTCWG Buildslave <tcwg-buildslave@linaro.org>2018-12-04 00:50:18 +0000
commita0200472e47941e3299a23ad144c6ea8c43067cb (patch)
tree308c4b13c9c7a1c7893a3bdf475427f36826abdb
parent23b8a21dabadcddda35505f8ef49bfb30abb32d5 (diff)
parent036b7091d719f417f1822e870c14e000fb6a432e (diff)
Merge commit '036b7091d719f417f1822e870c14e000fb6a432e' into tcwg-tested
Change-Id: I293b069277a58a2a4e1411ef47c0b881b3371373
-rwxr-xr-xtcwg-base/tcwg-llvmbot/run.sh24
1 files changed, 18 insertions, 6 deletions
diff --git a/tcwg-base/tcwg-llvmbot/run.sh b/tcwg-base/tcwg-llvmbot/run.sh
index f9d74916..d3308d49 100755
--- a/tcwg-base/tcwg-llvmbot/run.sh
+++ b/tcwg-base/tcwg-llvmbot/run.sh
@@ -137,14 +137,26 @@ exec /usr/bin/ninja -j$n_cores "\$@"
EOF
;;
*)
- # Throttle ninja on system load, system memory and container memory limit.
- # When running with "-l 2*N_CORES -m 50 -M 50" ninja will not start new jobs
- # if system or container memory utilization is beyond 50% or when load is
- # above double the core count. Ninja will also stall up to 5 seconds (-D 5000)
- # before starting a new job to avoid rapid increase of resource usage.
+ # Throttle ninja on system load, system memory and container memory
+ # limits.
+ case "$1" in
+ lab.llvm.org:9994)
+ # Run silent bots with single-threaded ninja when average load
+ # is beyond twice the number of cores.
+ avg_load_opt="-l $((2*$n_cores))"
+ ;;
+ *)
+ avg_load_opt=""
+ ;;
+ esac
+ # Make ninja run single-threaded if system or container memory
+ # utilization is beyond 50% (-m 50 -M 50).
+ # Make ninja stall for up to 5 seconds (-D 5000) before starting
+ # a new job when usage decreases under threshold (to avoid rapid
+ # increase of resource usage from N_CORES-1 new processes).
cat > /usr/local/bin/ninja <<EOF
#!/bin/sh
-exec /usr/local/bin/ninja.bin -j$n_cores -l $((2*$n_cores)) -m 50 -M 50 -D 5000 "\$@"
+exec /usr/local/bin/ninja.bin -j$n_cores $avg_load_opt -m 50 -M 50 -D 5000 "\$@"
EOF
;;
esac