lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210401185116.GH2696@paulmck-ThinkPad-P72>
Date:   Thu, 1 Apr 2021 11:51:16 -0700
From:   "Paul E. McKenney" <paulmck@...nel.org>
To:     Frederic Weisbecker <frederic@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] torture: Correctly fetch CPUs for kvm-build.sh with all
 native language

On Thu, Apr 01, 2021 at 03:26:02PM +0200, Frederic Weisbecker wrote:
> Grepping for "CPU" on lscpu output isn't always successful, depending
> on the local language setting. As a result, the build can be aborted
> early with:
> 
> 	"make: the '-j' option requires a positive integer argument"
> 
> Prefer a more generic solution.
> 
> Signed-off-by: Frederic Weisbecker <frederic@...nel.org>

Good catch, applied, thank you!

There is a similar construct in kvm-remote.sh, so I added a similar
fix to your patch.

But what about this in functions.sh?

nt="`lscpu | grep '^NUMA node0' | sed -e 's/^[^,]*,\([0-9]*\),.*$/\1/'`"

I am guessing that "node0" is human-language-independent, but is "NUMA"?

							Thanx, Paul

------------------------------------------------------------------------

commit cf519a9b736cf7dcd47920065e4de8c1855b5532
Author: Frederic Weisbecker <frederic@...nel.org>
Date:   Thu Apr 1 15:26:02 2021 +0200

    torture: Correctly fetch number of CPUs for non-English languages
    
    Grepping for "CPU" on lscpu output isn't always successful, depending
    on the local language setting.  As a result, the build can be aborted
    early with:
    
            "make: the '-j' option requires a positive integer argument"
    
    This commit therefore uses the human-language-independent approach
    available via the getconf command, both in kvm-build.sh and in
    kvm-remote.sh.
    
    Signed-off-by: Frederic Weisbecker <frederic@...nel.org>
    Signed-off-by: Paul E. McKenney <paulmck@...nel.org>

diff --git a/tools/testing/selftests/rcutorture/bin/kvm-build.sh b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
index 55f4fc1..5ad973d 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-build.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-build.sh
@@ -42,7 +42,7 @@ then
 fi
 
 # Tell "make" to use double the number of real CPUs on the build system.
-ncpus="`lscpu | grep '^CPU(' | awk '{ print $2 }'`"
+ncpus="`getconf _NPROCESSORS_ONLN`"
 make -j$((2 * ncpus)) $TORTURE_KMAKE_ARG > $resdir/Make.out 2>&1
 retval=$?
 if test $retval -ne 0 || grep "rcu[^/]*": < $resdir/Make.out | egrep -q "Stop|Error|error:|warning:" || egrep -q "Stop|Error|error:" < $resdir/Make.out
diff --git a/tools/testing/selftests/rcutorture/bin/kvm-remote.sh b/tools/testing/selftests/rcutorture/bin/kvm-remote.sh
index 0adaf26..92dd1a3 100755
--- a/tools/testing/selftests/rcutorture/bin/kvm-remote.sh
+++ b/tools/testing/selftests/rcutorture/bin/kvm-remote.sh
@@ -136,7 +136,7 @@ chmod +x $T/bin/kvm-remote-*.sh
 # Check first to avoid the need for cleanup for system-name typos
 for i in $systems
 do
-	ncpus="`ssh $i lscpu | grep '^CPU(' | awk '{ print $2 }'`"
+	ncpus="`ssh $i getconf _NPROCESSORS_ONLN 2> /dev/null`"
 	echo $i: $ncpus CPUs " " `date` | tee -a "$oldrun/remote-log"
 	ret=$?
 	if test "$ret" -ne 0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ