xfs
[Top] [All Lists]

Re: [PATCH 3/6] xfstest: allow fsstress to use load factor where appropr

To: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
Subject: Re: [PATCH 3/6] xfstest: allow fsstress to use load factor where appropriate
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Thu, 27 Sep 2012 10:19:19 +1000
Cc: linux-ext4@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, hch@xxxxxx, xfs@xxxxxxxxxxx
In-reply-to: <1348496601-32637-3-git-send-email-dmonakhov@xxxxxxxxxx>
References: <1348496601-32637-1-git-send-email-dmonakhov@xxxxxxxxxx> <1348496601-32637-3-git-send-email-dmonakhov@xxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Sep 24, 2012 at 06:23:18PM +0400, Dmitry Monakhov wrote:
> 
> Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
> ---
>  017 |    5 ++++-
>  068 |    4 ++--
>  070 |    4 +++-
>  076 |    5 ++++-
>  083 |    4 ++--
>  087 |   10 ++++++----
>  104 |    4 ++--
>  114 |    5 +++--
>  167 |    4 ++--
>  232 |    5 +++--
>  233 |    5 +++--
>  269 |    7 ++++---
>  270 |    7 ++++---
>  276 |   11 ++++++-----
>  14 files changed, 48 insertions(+), 32 deletions(-)
> 
> diff --git a/017 b/017
> index 9ca0e72..8d35ee8 100755
> --- a/017
> +++ b/017
> @@ -67,7 +67,10 @@ echo "*** test"
>  for l in 0 1 2 3 4
>  do
>          echo "    *** test $l"
> -        $FSSTRESS_PROG -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID >>$seq.full
> +     NUM=$((1000 * TIME_FACTOR))

$TIME_FACTOR, perhaps?

> +     CPU=$((1 * LOAD_FACTOR))
> +        $FSSTRESS_PROG -d $SCRATCH_MNT -n $NUM -p $CPU \
> +         $FSSTRESS_AVOID >>$seq.full

I'd much prefer a wrapper around fsstress than have to code this
into every test. Something like:

run_fstress()
{
        args=""

        while [ $# -gt 0 ]; do
                case "$1" in
                -n) args="$args $1 $(($2 * $TIME_FACTOR))"; shift ;;
                -p) args="$args $1 $(($2 * $LOAD_FACTOR))"; shift ;;
                *) args="$args $1" ;;
                esac

                shift
        done

        $FSSTRESS_PROG $args
}

And so all you need to do is something like:

$ sed -i 's/\$FSSTRESS_PROG/run_fsstress/' [0-9][0-9][0-9]

To convert all tests that use fsstress to do this.

You might also want to do this for the tests that run dirstress as
well, and create a "stress" group so that you can run just
the stress tests easily....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>