From nobody Sat Aug 17 08:38:43 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WmC2374WPz5SbJJ; Sat, 17 Aug 2024 08:38:51 +0000 (UTC) (envelope-from SRS0=TCzz=PQ=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WmC234MTdz4HGq; Sat, 17 Aug 2024 08:38:51 +0000 (UTC) (envelope-from SRS0=TCzz=PQ=klop.ws=ronald-lists@realworks.nl) Authentication-Results: mx1.freebsd.org; none Date: Sat, 17 Aug 2024 10:38:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1723883924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=mJGnhTdgZtZZYvA8sT7RFamUYLmgnrEcpWNrSAahfyI=; b=QR1ssmHpnVKVLnIQetQOaSySaXfjcoCn6V0uAu/K8i0Z096SB4E0qSLPRi4vKgEfSBoeKA KrU9vHCQFZwc0Sc//WdSEcvxLOQ65y8hGUQ6ew1+G8Z4Ci/G26J5ks+3ofFYV2CzM5IoIV Zpl6fn+OGsTry44lRW3aG4uNNZY4tErbU6VPEoo3ePJOMYp7NQW8fwToqBAWQDOy0nH1KG 4MtpH0qNPWUaCvwgVfP1QdYwEMWMfIYIiuIJLjyPEn2U6Uce35e2RGhrjI5ovbdaA5DvMl Xrt/mNWQhwXU2bWgQzUJPFIYYr5lc8uZGcnYMTPrmG3MNtRCnWMeY9MkQ4nl6g== From: Ronald Klop To: Peter Holm Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <1938701047.3129.1723883923856@localhost> In-Reply-To: <202408170638.47H6cT60006976@gitrepo.freebsd.org> Subject: Re: git: c7bc30c24f86 - main - stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3128_445269149.1723883923849" X-Mailer: Realworks (716.31) Importance: Normal X-Priority: 3 (Normal) X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:3265, ipnet:194.109.0.0/16, country:NL] X-Rspamd-Queue-Id: 4WmC234MTdz4HGq ------=_Part_3128_445269149.1723883923849 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Interesting. Why the cap? Can you explain what happened in the tests? Regards, Ronald. Van: Peter Holm Datum: 17 augustus 2024 08:38 Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Onderwerp: git: c7bc30c24f86 - main - stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped > > > The branch main has been updated by pho: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf > > commit c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf > Author: Peter Holm > AuthorDate: 2024-08-17 06:37:34 +0000 > Commit: Peter Holm > CommitDate: 2024-08-17 06:37:34 +0000 > > stress2: Some tests use hw.ncpu to scale the load. Tests on a box with > a large number of CPUs show that this number needs to be capped > --- > tools/test/stress2/misc/buildkernel.sh | 1 + > tools/test/stress2/misc/buildworld.sh | 1 + > tools/test/stress2/misc/buildworld2.sh | 1 + > tools/test/stress2/misc/buildworld3.sh | 1 + > tools/test/stress2/misc/buildworld4.sh | 1 + > tools/test/stress2/misc/crossmp3.sh | 1 + > tools/test/stress2/misc/crossmp4.sh | 1 + > tools/test/stress2/misc/crossmp5.sh | 1 + > tools/test/stress2/misc/crossmp8.sh | 1 + > tools/test/stress2/misc/gnop4.sh | 3 +++ > tools/test/stress2/misc/tmpfs13.sh | 1 + > tools/test/stress2/misc/zzbuildworld.sh | 1 + > 12 files changed, 14 insertions(+) > > diff --git a/tools/test/stress2/misc/buildkernel.sh b/tools/test/stress2/misc/buildkernel.sh > index 849a09b81439..e0aa85617f9b 100755 > --- a/tools/test/stress2/misc/buildkernel.sh > +++ b/tools/test/stress2/misc/buildkernel.sh > @@ -49,6 +49,7 @@ chmod 0777 $TMPDIR > log=$mntpoint/log > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Arbitrary cap > p=`jot -r 1 1 $p` > echo "make -j $p buildkernel KERNCONF=GENERIC DESTDIR=$mntpoint" > "TARGET=amd64 TARGET_ARCH=amd64" > diff --git a/tools/test/stress2/misc/buildworld.sh b/tools/test/stress2/misc/buildworld.sh > index 595b387c90ae..3b362ec7041a 100755 > --- a/tools/test/stress2/misc/buildworld.sh > +++ b/tools/test/stress2/misc/buildworld.sh > @@ -55,6 +55,7 @@ mkdir $TMPDIR > chmod 0777 $TMPDIR > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Arbitrary cap > timeout 20m make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 > TARGET_ARCH=amd64 > /dev/null > > diff --git a/tools/test/stress2/misc/buildworld2.sh b/tools/test/stress2/misc/buildworld2.sh > index 9c1eed97b7ea..3653cb1db5b4 100755 > --- a/tools/test/stress2/misc/buildworld2.sh > +++ b/tools/test/stress2/misc/buildworld2.sh > @@ -46,6 +46,7 @@ mkdir $TMPDIR > chmod 0777 $TMPDIR > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Arbitrary cap > make -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 > > /dev/null & > sleep $((20 * 60)) > diff --git a/tools/test/stress2/misc/buildworld3.sh b/tools/test/stress2/misc/buildworld3.sh > index 0c660cae8eae..e3bce2764c0c 100755 > --- a/tools/test/stress2/misc/buildworld3.sh > +++ b/tools/test/stress2/misc/buildworld3.sh > @@ -62,6 +62,7 @@ mkdir $TMPDIR $MAKEOBJDIRPREFIX > chmod 0777 $TMPDIR $MAKEOBJDIRPREFIX > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Arbitrary cap > su $testuser -c > "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 > TARGET_ARCH=amd64 > /dev/null" & > diff --git a/tools/test/stress2/misc/buildworld4.sh b/tools/test/stress2/misc/buildworld4.sh > index 6c15a72a9dcb..d1d162120952 100755 > --- a/tools/test/stress2/misc/buildworld4.sh > +++ b/tools/test/stress2/misc/buildworld4.sh > @@ -50,6 +50,7 @@ mkdir $TMPDIR > chmod 0777 $TMPDIR > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 16 ] && p=16 # Arbitrary cap > [ `sysctl -n vm.swap_total` -gt 0 ] && p=$((p * 4)) > p=`jot -r 1 1 $p` > echo "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 " > diff --git a/tools/test/stress2/misc/crossmp3.sh b/tools/test/stress2/misc/crossmp3.sh > index 5eecb936e900..32c625a1e4ad 100755 > --- a/tools/test/stress2/misc/crossmp3.sh > +++ b/tools/test/stress2/misc/crossmp3.sh > @@ -41,6 +41,7 @@ > CONT=/tmp/crossmp3.continue > if [ $# -eq 0 ]; then > N=`sysctl -n hw.ncpu` > + [ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `sysctl -n vm.swap_total` -eq 0 ] && usermem=$((usermem / 2)) > size=$((usermem / 1024 / 1024 / N)) > diff --git a/tools/test/stress2/misc/crossmp4.sh b/tools/test/stress2/misc/crossmp4.sh > index e22f969b72bb..21d22bee69e5 100755 > --- a/tools/test/stress2/misc/crossmp4.sh > +++ b/tools/test/stress2/misc/crossmp4.sh > @@ -40,6 +40,7 @@ > . ../default.cfg > > N=`sysctl -n hw.ncpu` > +[ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > size=$((usermem / 1024 / 1024 - 2)) > diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh > index 038dea7ebe4f..6e504d9f20ad 100755 > --- a/tools/test/stress2/misc/crossmp5.sh > +++ b/tools/test/stress2/misc/crossmp5.sh > @@ -33,6 +33,7 @@ > . ../default.cfg > > N=`sysctl -n hw.ncpu` > +[ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > size=$((usermem / 1024 / 1024 / N)) > diff --git a/tools/test/stress2/misc/crossmp8.sh b/tools/test/stress2/misc/crossmp8.sh > index e877dfaf6d1c..eec5ba9bc7c1 100755 > --- a/tools/test/stress2/misc/crossmp8.sh > +++ b/tools/test/stress2/misc/crossmp8.sh > @@ -41,6 +41,7 @@ > > CONT=/tmp/crossmp8.continue > N=`sysctl -n hw.ncpu` > +[ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > size=$((usermem / 1024 / 1024 / N)) > diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh > index f938dd3b790b..1b4da74266f6 100755 > --- a/tools/test/stress2/misc/gnop4.sh > +++ b/tools/test/stress2/misc/gnop4.sh > @@ -34,6 +34,8 @@ > # https://people.freebsd.org/~pho/stress/log/kostik1017.txt > # Fixed by r322175 > > +# Seen with p=513: Threads stuck in "ffsrca" > + > . ../default.cfg > > gigs=9 > @@ -62,6 +64,7 @@ cd $mntpoint/src > export MAKEOBJDIRPREFIX=$mntpoint/obj > > p=$((`sysctl -n hw.ncpu`+ 1)) > +[ $p -gt 32 ] && p=32 # Temporary work around > timeout 10m > make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 > TARGET_ARCH=amd64 > /dev/null > diff --git a/tools/test/stress2/misc/tmpfs13.sh b/tools/test/stress2/misc/tmpfs13.sh > index 29b44cbc9ad4..231c42033f9d 100755 > --- a/tools/test/stress2/misc/tmpfs13.sh > +++ b/tools/test/stress2/misc/tmpfs13.sh > @@ -40,6 +40,7 @@ > . ../default.cfg > > N=`sysctl -n hw.ncpu` > +[ $N -gt 32 ] && N=32 # Arbitrary cap > usermem=`sysctl -n hw.usermem` > [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80)) > size=$((usermem / 1024 / 1024 / 2)) > diff --git a/tools/test/stress2/misc/zzbuildworld.sh b/tools/test/stress2/misc/zzbuildworld.sh > index 2104eb156c86..e1bf867d8d5f 100755 > --- a/tools/test/stress2/misc/zzbuildworld.sh > +++ b/tools/test/stress2/misc/zzbuildworld.sh > @@ -44,6 +44,7 @@ top=$mntpoint > export MAKEOBJDIRPREFIX=$top/obj > export log=$top/buildworld.`date +%Y%m%dT%H%M` > n=$((`sysctl -n hw.ncpu` + 1)) > +[ $n -gt 32 ] && n=32 # Arbitrary cap > cd $src > make -j$n buildworld > $log 2>&1 && s=0 ||s=1 > grep '***' $log && s=2 > > > > > ------=_Part_3128_445269149.1723883923849 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Interesting. Why the cap?
Can you explain what happened in the tests?

Regards,
Ronald.

Van: Peter Holm <pho@FreeBSD.org>
Datum: 17 augustus 2024 08:38
Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Onderwerp: git: c7bc30c24f86 - main - stress2: Some tests use hw.ncpu to scale the load. Tests on a box with a large number of CPUs show that this number needs to be capped

The branch main has been updated by pho:

URL: https://cgit.FreeBSD.org/src/commit/?id=c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf

commit c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf
Author:     Peter Holm
AuthorDate: 2024-08-17 06:37:34 +0000
Commit:     Peter Holm
CommitDate: 2024-08-17 06:37:34 +0000

    stress2: Some tests use hw.ncpu to scale the load. Tests on a box with
    a large number of CPUs show that this number needs to be capped
---
 tools/test/stress2/misc/buildkernel.sh  | 1 +
 tools/test/stress2/misc/buildworld.sh   | 1 +
 tools/test/stress2/misc/buildworld2.sh  | 1 +
 tools/test/stress2/misc/buildworld3.sh  | 1 +
 tools/test/stress2/misc/buildworld4.sh  | 1 +
 tools/test/stress2/misc/crossmp3.sh     | 1 +
 tools/test/stress2/misc/crossmp4.sh     | 1 +
 tools/test/stress2/misc/crossmp5.sh     | 1 +
 tools/test/stress2/misc/crossmp8.sh     | 1 +
 tools/test/stress2/misc/gnop4.sh        | 3 +++
 tools/test/stress2/misc/tmpfs13.sh      | 1 +
 tools/test/stress2/misc/zzbuildworld.sh | 1 +
 12 files changed, 14 insertions(+)

diff --git a/tools/test/stress2/misc/buildkernel.sh b/tools/test/stress2/misc/buildkernel.sh
index 849a09b81439..e0aa85617f9b 100755
--- a/tools/test/stress2/misc/buildkernel.sh
+++ b/tools/test/stress2/misc/buildkernel.sh
@@ -49,6 +49,7 @@ chmod 0777 $TMPDIR
 log=$mntpoint/log
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Arbitrary cap
 p=`jot -r 1 1 $p`
 echo "make -j $p buildkernel KERNCONF=GENERIC DESTDIR=$mntpoint"
     "TARGET=amd64 TARGET_ARCH=amd64"
diff --git a/tools/test/stress2/misc/buildworld.sh b/tools/test/stress2/misc/buildworld.sh
index 595b387c90ae..3b362ec7041a 100755
--- a/tools/test/stress2/misc/buildworld.sh
+++ b/tools/test/stress2/misc/buildworld.sh
@@ -55,6 +55,7 @@ mkdir $TMPDIR
 chmod 0777 $TMPDIR
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Arbitrary cap
 timeout 20m make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64
     TARGET_ARCH=amd64 > /dev/null
 
diff --git a/tools/test/stress2/misc/buildworld2.sh b/tools/test/stress2/misc/buildworld2.sh
index 9c1eed97b7ea..3653cb1db5b4 100755
--- a/tools/test/stress2/misc/buildworld2.sh
+++ b/tools/test/stress2/misc/buildworld2.sh
@@ -46,6 +46,7 @@ mkdir $TMPDIR
 chmod 0777 $TMPDIR
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Arbitrary cap
 make -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64
     > /dev/null &
 sleep $((20 *  60))
diff --git a/tools/test/stress2/misc/buildworld3.sh b/tools/test/stress2/misc/buildworld3.sh
index 0c660cae8eae..e3bce2764c0c 100755
--- a/tools/test/stress2/misc/buildworld3.sh
+++ b/tools/test/stress2/misc/buildworld3.sh
@@ -62,6 +62,7 @@ mkdir $TMPDIR $MAKEOBJDIRPREFIX
 chmod 0777 $TMPDIR $MAKEOBJDIRPREFIX
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Arbitrary cap
 su $testuser -c
     "make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64
     TARGET_ARCH=amd64 > /dev/null" &
diff --git a/tools/test/stress2/misc/buildworld4.sh b/tools/test/stress2/misc/buildworld4.sh
index 6c15a72a9dcb..d1d162120952 100755
--- a/tools/test/stress2/misc/buildworld4.sh
+++ b/tools/test/stress2/misc/buildworld4.sh
@@ -50,6 +50,7 @@ mkdir $TMPDIR
 chmod 0777 $TMPDIR
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 16 ] && p=16  # Arbitrary cap
 [ `sysctl -n vm.swap_total` -gt 0 ] && p=$((p * 4))
 p=`jot -r 1 1 $p`
 echo "make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64 "
diff --git a/tools/test/stress2/misc/crossmp3.sh b/tools/test/stress2/misc/crossmp3.sh
index 5eecb936e900..32c625a1e4ad 100755
--- a/tools/test/stress2/misc/crossmp3.sh
+++ b/tools/test/stress2/misc/crossmp3.sh
@@ -41,6 +41,7 @@
 CONT=/tmp/crossmp3.continue
 if [ $# -eq 0 ]; then
    N=`sysctl -n hw.ncpu`
+   [ $N -gt 32 ] && N=32  # Arbitrary cap
    usermem=`sysctl -n hw.usermem`
    [ `sysctl -n vm.swap_total` -eq 0 ] && usermem=$((usermem / 2))
    size=$((usermem / 1024 / 1024 / N))
diff --git a/tools/test/stress2/misc/crossmp4.sh b/tools/test/stress2/misc/crossmp4.sh
index e22f969b72bb..21d22bee69e5 100755
--- a/tools/test/stress2/misc/crossmp4.sh
+++ b/tools/test/stress2/misc/crossmp4.sh
@@ -40,6 +40,7 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
+[ $N -gt 32 ] && N=32  # Arbitrary cap
 usermem=`sysctl -n hw.usermem`
 [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
 size=$((usermem / 1024 / 1024 - 2))
diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh
index 038dea7ebe4f..6e504d9f20ad 100755
--- a/tools/test/stress2/misc/crossmp5.sh
+++ b/tools/test/stress2/misc/crossmp5.sh
@@ -33,6 +33,7 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
+[ $N -gt 32 ] && N=32  # Arbitrary cap
 usermem=`sysctl -n hw.usermem`
 [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
 size=$((usermem / 1024 / 1024 / N))
diff --git a/tools/test/stress2/misc/crossmp8.sh b/tools/test/stress2/misc/crossmp8.sh
index e877dfaf6d1c..eec5ba9bc7c1 100755
--- a/tools/test/stress2/misc/crossmp8.sh
+++ b/tools/test/stress2/misc/crossmp8.sh
@@ -41,6 +41,7 @@
 
 CONT=/tmp/crossmp8.continue
 N=`sysctl -n hw.ncpu`
+[ $N -gt 32 ] && N=32  # Arbitrary cap
 usermem=`sysctl -n hw.usermem`
 [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
 size=$((usermem / 1024 / 1024 / N))
diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh
index f938dd3b790b..1b4da74266f6 100755
--- a/tools/test/stress2/misc/gnop4.sh
+++ b/tools/test/stress2/misc/gnop4.sh
@@ -34,6 +34,8 @@
 # https://people.freebsd.org/~pho/stress/log/kostik1017.txt
 # Fixed by r322175
 
+# Seen with p=513: Threads stuck in "ffsrca"
+
 . ../default.cfg
 
 gigs=9
@@ -62,6 +64,7 @@ cd $mntpoint/src
 export MAKEOBJDIRPREFIX=$mntpoint/obj
 
 p=$((`sysctl -n hw.ncpu`+ 1))
+[ $p -gt 32 ] && p=32  # Temporary work around
 timeout 10m
     make -i -j $p buildworld  DESTDIR=$mntpoint TARGET=amd64
     TARGET_ARCH=amd64 > /dev/null
diff --git a/tools/test/stress2/misc/tmpfs13.sh b/tools/test/stress2/misc/tmpfs13.sh
index 29b44cbc9ad4..231c42033f9d 100755
--- a/tools/test/stress2/misc/tmpfs13.sh
+++ b/tools/test/stress2/misc/tmpfs13.sh
@@ -40,6 +40,7 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
+[ $N -gt 32 ] && N=32  # Arbitrary cap
 usermem=`sysctl -n hw.usermem`
 [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
 size=$((usermem / 1024 / 1024 / 2))
diff --git a/tools/test/stress2/misc/zzbuildworld.sh b/tools/test/stress2/misc/zzbuildworld.sh
index 2104eb156c86..e1bf867d8d5f 100755
--- a/tools/test/stress2/misc/zzbuildworld.sh
+++ b/tools/test/stress2/misc/zzbuildworld.sh
@@ -44,6 +44,7 @@ top=$mntpoint
 export MAKEOBJDIRPREFIX=$top/obj
 export log=$top/buildworld.`date +%Y%m%dT%H%M`
 n=$((`sysctl -n hw.ncpu` + 1))
+[ $n -gt 32 ] && n=32  # Arbitrary cap
 cd $src
 make -j$n buildworld > $log 2>&1 && s=0 ||s=1
 grep  '***' $log && s=2





------=_Part_3128_445269149.1723883923849--