At present, our "fast" runners provided by OSU OSL have a CPU cgroups
limit of 28, which means that we don't run our jobs as quickly as we
might expect given the number of threads that our older version of nproc
sees here. On the OSU OSL side of things, they are aware and working on
a set of overall improvements to everyone using the shared
infrastructure. For the moment, we want to limit what buildman fires off
in this case to not essentially fork-bomb ourselves. Figure out our
cgroups limit and pass -T if needed, or nothing if no limit.

Suggested-by: Lance Albertson at OSU OSL
Signed-off-by: Tom Rini <[email protected]>
---
Changes in v2:
- Lance provided a better idea here that will also enable seamless
  testing of their backend changes, as they happen.
---
 .gitlab-ci.yml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e08068f1cbf5..0338f20b8a2e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -157,8 +157,11 @@ build all platforms in a single job:
         -r board/qualcomm/requirements.txt
         setuptools
     - ret=0;
+      if read q p < /sys/fs/cgroup/cpu.max 2>/dev/null && [ "$q" != max ]; then
+        T="-T $(( (q + p - 1) / p ))";
+      fi;
       git config --global --add safe.directory "${CI_PROJECT_DIR}";
-      ./tools/buildman/buildman -o /tmp -PEWM -x xtensa || ret=$?;
+      ./tools/buildman/buildman ${T} -o /tmp -PEWM -x xtensa || ret=$?;
       if [[ $ret -ne 0 ]]; then
         ./tools/buildman/buildman -o /tmp -seP;
         exit $ret;
-- 
2.43.0

Reply via email to