Date: Sat, 17 Aug 2024 10:38:43 +0200 (CEST) From: Ronald Klop <ronald-lists@klop.ws> To: Peter Holm <pho@FreeBSD.org> Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@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 Message-ID: <1938701047.3129.1723883923856@localhost> In-Reply-To: <202408170638.47H6cT60006976@gitrepo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_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 <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 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit <html><head></head><body>Interesting. Why the cap?<div>Can you explain what happened in the tests?</div><div><br></div><div>Regards,</div><div>Ronald.</div><div><br><p><small><strong>Van:</strong> Peter Holm <pho@FreeBSD.org><br><strong>Datum:</strong> 17 augustus 2024 08:38<br><strong>Aan:</strong> src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org<br><strong>Onderwerp:</strong> 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<br></small></p><blockquote style="margin-left: 5px; border-left: 3px solid #ccc; margin-right: 0px; padding-left: 5px;"><div class="MessageRFC822Viewer" id="P"><!-- P --> <!-- processMimeMessage --><div class="TextPlainViewer" id="P.P"><!-- P.P -->The branch main has been updated by pho:<br> <br> URL: <a href="https://cgit.FreeBSD.org/src/commit/?id=c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf">https://cgit.FreeBSD.org/src/commit/?id=c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf</a><br> <br> commit c7bc30c24f8625c6e9ef41be427fa26c6eb3d2bf<br> Author: Peter Holm <pho@freebsd.org><br> AuthorDate: 2024-08-17 06:37:34 +0000<br> Commit: Peter Holm <pho@freebsd.org><br> CommitDate: 2024-08-17 06:37:34 +0000<br> <br> stress2: Some tests use hw.ncpu to scale the load. Tests on a box with<br> a large number of CPUs show that this number needs to be capped<br> ---<br> tools/test/stress2/misc/buildkernel.sh | 1 +<br> tools/test/stress2/misc/buildworld.sh | 1 +<br> tools/test/stress2/misc/buildworld2.sh | 1 +<br> tools/test/stress2/misc/buildworld3.sh | 1 +<br> tools/test/stress2/misc/buildworld4.sh | 1 +<br> tools/test/stress2/misc/crossmp3.sh | 1 +<br> tools/test/stress2/misc/crossmp4.sh | 1 +<br> tools/test/stress2/misc/crossmp5.sh | 1 +<br> tools/test/stress2/misc/crossmp8.sh | 1 +<br> tools/test/stress2/misc/gnop4.sh | 3 +++<br> tools/test/stress2/misc/tmpfs13.sh | 1 +<br> tools/test/stress2/misc/zzbuildworld.sh | 1 +<br> 12 files changed, 14 insertions(+)<br> <br> diff --git a/tools/test/stress2/misc/buildkernel.sh b/tools/test/stress2/misc/buildkernel.sh<br> index 849a09b81439..e0aa85617f9b 100755<br> --- a/tools/test/stress2/misc/buildkernel.sh<br> +++ b/tools/test/stress2/misc/buildkernel.sh<br> @@ -49,6 +49,7 @@ chmod 0777 $TMPDIR<br> log=$mntpoint/log<br> <br> p=$((`sysctl -n hw.ncpu`+ 1))<br> +[ $p -gt 32 ] && p=32 # Arbitrary cap<br> p=`jot -r 1 1 $p`<br> echo "make -j $p buildkernel KERNCONF=GENERIC DESTDIR=$mntpoint" <br> "TARGET=amd64 TARGET_ARCH=amd64"<br> diff --git a/tools/test/stress2/misc/buildworld.sh b/tools/test/stress2/misc/buildworld.sh<br> index 595b387c90ae..3b362ec7041a 100755<br> --- a/tools/test/stress2/misc/buildworld.sh<br> +++ b/tools/test/stress2/misc/buildworld.sh<br> @@ -55,6 +55,7 @@ mkdir $TMPDIR<br> chmod 0777 $TMPDIR<br> <br> p=$((`sysctl -n hw.ncpu`+ 1))<br> +[ $p -gt 32 ] && p=32 # Arbitrary cap<br> timeout 20m make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 <br> TARGET_ARCH=amd64 > /dev/null<br> <br> diff --git a/tools/test/stress2/misc/buildworld2.sh b/tools/test/stress2/misc/buildworld2.sh<br> index 9c1eed97b7ea..3653cb1db5b4 100755<br> --- a/tools/test/stress2/misc/buildworld2.sh<br> +++ b/tools/test/stress2/misc/buildworld2.sh<br> @@ -46,6 +46,7 @@ mkdir $TMPDIR<br> chmod 0777 $TMPDIR<br> <br> p=$((`sysctl -n hw.ncpu`+ 1))<br> +[ $p -gt 32 ] && p=32 # Arbitrary cap<br> make -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 TARGET_ARCH=amd64 <br> > /dev/null &<br> sleep $((20 * 60))<br> diff --git a/tools/test/stress2/misc/buildworld3.sh b/tools/test/stress2/misc/buildworld3.sh<br> index 0c660cae8eae..e3bce2764c0c 100755<br> --- a/tools/test/stress2/misc/buildworld3.sh<br> +++ b/tools/test/stress2/misc/buildworld3.sh<br> @@ -62,6 +62,7 @@ mkdir $TMPDIR $MAKEOBJDIRPREFIX<br> chmod 0777 $TMPDIR $MAKEOBJDIRPREFIX<br> <br> p=$((`sysctl -n hw.ncpu`+ 1))<br> +[ $p -gt 32 ] && p=32 # Arbitrary cap<br> su $testuser -c <br> "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 <br> TARGET_ARCH=amd64 > /dev/null" &<br> diff --git a/tools/test/stress2/misc/buildworld4.sh b/tools/test/stress2/misc/buildworld4.sh<br> index 6c15a72a9dcb..d1d162120952 100755<br> --- a/tools/test/stress2/misc/buildworld4.sh<br> +++ b/tools/test/stress2/misc/buildworld4.sh<br> @@ -50,6 +50,7 @@ mkdir $TMPDIR<br> chmod 0777 $TMPDIR<br> <br> p=$((`sysctl -n hw.ncpu`+ 1))<br> +[ $p -gt 16 ] && p=16 # Arbitrary cap<br> [ `sysctl -n vm.swap_total` -gt 0 ] && p=$((p * 4))<br> p=`jot -r 1 1 $p`<br> echo "make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 "<br> diff --git a/tools/test/stress2/misc/crossmp3.sh b/tools/test/stress2/misc/crossmp3.sh<br> index 5eecb936e900..32c625a1e4ad 100755<br> --- a/tools/test/stress2/misc/crossmp3.sh<br> +++ b/tools/test/stress2/misc/crossmp3.sh<br> @@ -41,6 +41,7 @@<br> CONT=/tmp/crossmp3.continue<br> if [ $# -eq 0 ]; then<br> N=`sysctl -n hw.ncpu`<br> + [ $N -gt 32 ] && N=32 # Arbitrary cap<br> usermem=`sysctl -n hw.usermem`<br> [ `sysctl -n vm.swap_total` -eq 0 ] && usermem=$((usermem / 2))<br> size=$((usermem / 1024 / 1024 / N))<br> diff --git a/tools/test/stress2/misc/crossmp4.sh b/tools/test/stress2/misc/crossmp4.sh<br> index e22f969b72bb..21d22bee69e5 100755<br> --- a/tools/test/stress2/misc/crossmp4.sh<br> +++ b/tools/test/stress2/misc/crossmp4.sh<br> @@ -40,6 +40,7 @@<br> . ../default.cfg<br> <br> N=`sysctl -n hw.ncpu`<br> +[ $N -gt 32 ] && N=32 # Arbitrary cap<br> usermem=`sysctl -n hw.usermem`<br> [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))<br> size=$((usermem / 1024 / 1024 - 2))<br> diff --git a/tools/test/stress2/misc/crossmp5.sh b/tools/test/stress2/misc/crossmp5.sh<br> index 038dea7ebe4f..6e504d9f20ad 100755<br> --- a/tools/test/stress2/misc/crossmp5.sh<br> +++ b/tools/test/stress2/misc/crossmp5.sh<br> @@ -33,6 +33,7 @@<br> . ../default.cfg<br> <br> N=`sysctl -n hw.ncpu`<br> +[ $N -gt 32 ] && N=32 # Arbitrary cap<br> usermem=`sysctl -n hw.usermem`<br> [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))<br> size=$((usermem / 1024 / 1024 / N))<br> diff --git a/tools/test/stress2/misc/crossmp8.sh b/tools/test/stress2/misc/crossmp8.sh<br> index e877dfaf6d1c..eec5ba9bc7c1 100755<br> --- a/tools/test/stress2/misc/crossmp8.sh<br> +++ b/tools/test/stress2/misc/crossmp8.sh<br> @@ -41,6 +41,7 @@<br> <br> CONT=/tmp/crossmp8.continue<br> N=`sysctl -n hw.ncpu`<br> +[ $N -gt 32 ] && N=32 # Arbitrary cap<br> usermem=`sysctl -n hw.usermem`<br> [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))<br> size=$((usermem / 1024 / 1024 / N))<br> diff --git a/tools/test/stress2/misc/gnop4.sh b/tools/test/stress2/misc/gnop4.sh<br> index f938dd3b790b..1b4da74266f6 100755<br> --- a/tools/test/stress2/misc/gnop4.sh<br> +++ b/tools/test/stress2/misc/gnop4.sh<br> @@ -34,6 +34,8 @@<br> # <a href="https://people.freebsd.org/~pho/stress/log/kostik1017.txt">https://people.freebsd.org/~pho/stress/log/kostik1017.txt</a><br> # Fixed by r322175<br> <br> +# Seen with p=513: Threads stuck in "ffsrca"<br> +<br> . ../default.cfg<br> <br> gigs=9<br> @@ -62,6 +64,7 @@ cd $mntpoint/src<br> export MAKEOBJDIRPREFIX=$mntpoint/obj<br> <br> p=$((`sysctl -n hw.ncpu`+ 1))<br> +[ $p -gt 32 ] && p=32 # Temporary work around<br> timeout 10m <br> make -i -j $p buildworld DESTDIR=$mntpoint TARGET=amd64 <br> TARGET_ARCH=amd64 > /dev/null<br> diff --git a/tools/test/stress2/misc/tmpfs13.sh b/tools/test/stress2/misc/tmpfs13.sh<br> index 29b44cbc9ad4..231c42033f9d 100755<br> --- a/tools/test/stress2/misc/tmpfs13.sh<br> +++ b/tools/test/stress2/misc/tmpfs13.sh<br> @@ -40,6 +40,7 @@<br> . ../default.cfg<br> <br> N=`sysctl -n hw.ncpu`<br> +[ $N -gt 32 ] && N=32 # Arbitrary cap<br> usermem=`sysctl -n hw.usermem`<br> [ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))<br> size=$((usermem / 1024 / 1024 / 2))<br> diff --git a/tools/test/stress2/misc/zzbuildworld.sh b/tools/test/stress2/misc/zzbuildworld.sh<br> index 2104eb156c86..e1bf867d8d5f 100755<br> --- a/tools/test/stress2/misc/zzbuildworld.sh<br> +++ b/tools/test/stress2/misc/zzbuildworld.sh<br> @@ -44,6 +44,7 @@ top=$mntpoint<br> export MAKEOBJDIRPREFIX=$top/obj<br> export log=$top/buildworld.`date +%Y%m%dT%H%M`<br> n=$((`sysctl -n hw.ncpu` + 1))<br> +[ $n -gt 32 ] && n=32 # Arbitrary cap<br> cd $src<br> make -j$n buildworld > $log 2>&1 && s=0 ||s=1<br> grep '***' $log && s=2<br> <br> </pho@freebsd.org></pho@freebsd.org></div><!-- TextPlainViewer --> <hr> </div><!-- MessageRFC822Viewer --> </blockquote><br><br><br></div></body></html> ------=_Part_3128_445269149.1723883923849--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1938701047.3129.1723883923856>