From 34ed134da18e70738fb9138ea435473b82b24b4d Mon Sep 17 00:00:00 2001 From: Matthias Klose Date: Fri, 1 Dec 2023 19:13:33 +0100 Subject: [PATCH] * Also use the free swap to determine the number of parallel processes. --- debian/changelog | 1 + debian/rules | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 8c6077bf..49c01646 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,6 +18,7 @@ llvm-toolchain-snapshot (1:18~++20230921012857+4cf8da94198d-1~exp1) UNRELEASED; * libclang1-18: Only encode the major version in the soname. See #1056126. * Restore the patch for D148945, searching /usr/lib/llvm-18/lib by default. Addresses: #1056580. + * Also use the free swap to determine the number of parallel processes. [ John Paul Adrian Glaubitz ] * Don't install *clang_rt* on sparc and sparc64 diff --git a/debian/rules b/debian/rules index c6b5c954..4e685647 100755 --- a/debian/rules +++ b/debian/rules @@ -53,7 +53,7 @@ ifneq (,$(filter flang-$(LLVM_VERSION), $(packages))) else MEM_PER_CPU=2100 endif -NJOBS := $(shell mt=`awk '/^MemTotal/ { print $$2 }' /proc/meminfo`; \ +NJOBS := $(shell mt=`awk '/^(MemAvail|SwapFree)/ { mt += $$2 } END {print mt}' /proc/meminfo`; \ awk -vn=$(NCPUS) -vmt=$$mt -vm=$(MEM_PER_CPU) \ 'END { mt/=1024; n2 = int(mt/m); print n==1 ? 1 : n2