reduce the number of processes forked

One of the big cpu time consumers when running xfsqa on UML
is forking of new processes. when looping lots of times,
using 'expr' to calculate the loop counter increment means
we fork at least once every loop. using shell builtins means
that we don't fork and many tests run substantially faster.

Some tests are even runnable with this modification. e.g. 110
went from taking 4500s to run down to 9s with the loop iterators
changed to avoid forking.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Dave Chinner
2009-03-25 20:53:36 +01:00
committed by Christoph Hellwig
parent d3592f9b21
commit e714acc0ef
30 changed files with 72 additions and 72 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ while [ $i -lt $max ]; do
xfs_freeze -f $SCRATCH_MNT
xfs_freeze -u $SCRATCH_MNT
echo -n .
i=`expr $i + 1`
let i=$i+1
done
echo "done"