]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/072: limit max cpu number to 8
authorEryu Guan <eguan@redhat.com>
Thu, 18 Feb 2016 23:40:56 +0000 (10:40 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 18 Feb 2016 23:40:56 +0000 (10:40 +1100)
Right now generic/072 scales the loop count based on the cpu count. But
on hosts with many cpus(100+), generic/072 runs for hours and generates
very high system load.

Given that the original bug can be reproduced easily on unpatched
kernel, the great number of loops and long run time are not needed. So
limiting the cpu number to 8 (which gives around 20 seconds run time on
my test vm with 8 vcpus) seems reasonable.

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/generic/072

index 6e59d84cd12c5d23c279942a65e1260a1d90893b..ece71fb06b56c3624105827a33597215b110e7d1 100755 (executable)
@@ -51,6 +51,10 @@ _require_xfs_io_command "fcollapse"
 
 testfile=$TEST_DIR/testfile.$seq
 NCPUS=`$here/src/feature -o`
+# cap NCPUS to 8 at maximum to avoid long run time on hosts with many cpus
+if [ $NCPUS -gt 8 ]; then
+       NCPUS=8
+fi
 OUTER_LOOPS=$((10 * $NCPUS * $LOAD_FACTOR))
 INNER_LOOPS=$((50 * $NCPUS * $LOAD_FACTOR))
 # fcollapse/truncate continuously and simultaneously a same file