[LTP] [PATCH v7] Rewrite aio-stress test using LTP API

Petr Vorel pvorel@suse.cz
Fri Oct 7 11:17:06 CEST 2022


Hi Andrea,

below are just minor comments about options and doc/help.

> diff --git a/runtest/ltp-aio-stress.part1 b/runtest/ltp-aio-stress.part1
...
> -# aio-stress [-s size] [-r size] [-a size] [-d num] [-b num]
> -#                 [-i num] [-t num] [-c num] [-C size] [-nxhlvOS ]
> -#                 file1 [file2 ...]
> -#       -a size in KB at which to align buffers
> -#       -b max number of iocbs to give io_submit at once
> -#       -c number of io contexts per file
> -#       -C offset between contexts, default 2MB
> -#       -s size in MB of the test file(s), default 1024MB
> -#       -r record size in KB used for each io, default 64KB
> -#       -d number of pending aio requests for each file, default 64
> -#       -i number of ios per file sent before switching
> -#          to the next file, default 8
> -#       -O Use O_DIRECT (not available in 2.4 kernels),
> -#       -S Use O_SYNC for writes
> -#       -o add an operation to the list: write=0, read=1,
> -#          random write=2, random read=3.
> -#          repeat -o to specify multiple ops: -o 0 -o 1 etc.
> -#       -m shm use ipc shared memory for io buffers instead of malloc
> -#       -m shmfs mmap a file in /dev/shm for io buffers
> -#       -n no fsyncs between write stage and read stage
> -#       -l print io_submit latencies after each stage
> -#       -t number of threads to run
> -#       -v verification of bytes written
> -#       -x turn off thread stonewalling
> -#       -h this message
> +# -f       Number of files to generate
> +# -b       Max number of iocbs to give io_submit at once
> +# -c       Number of io contexts per file
> +# -g       Offset between contexts (default 2M)
> +# -s       Size in MB of the test file(s) (default 1024M)
> +# -r       Record size in KB used for each io (default 64K)
> +# -d       Number of pending aio requests for each file (default 64)
> +# -e       Number of I/O per file sent before switching to the next file (default 8)
> +# -a       Total number of ayncs I/O the program will run, default is run until Cntl-C
Could we have -a500 as the default value (and thus remove it from runtest
file)? IMHO it's better that run indefinitely, because it dies with TBROK after 30 sec on timeout.

also could have aio-stress -h sorted output? (easier to read on so many
options).

> +# -O       Use O_DIRECT (not available in 2.4 kernels)
> +# -o       Add an operation to the list: write=0, read=1, random write=2, random read=3
> +# -m       SHM use ipc shared memory for io buffers instead of malloc
> +# -n       No fsyncs between write stage and read stage
> +# -l       Print io_submit latencies after each stage
> +# -L       Print io completion latencies after each stage
> +# -t       Number of threads to run
> +# -u       Unlink files after completion
> +# -v       Verification of bytes written
> +# -x       Turn off thread stonewalling
nit: I'd remove these, IMHO it's not worth to sync this with aio-stress.c.
One can find getopts string in aio-stress.c.

...
> -ADS1050 aio-stress -I500  -o1 -O -r256  -t2   $TMPDIR/junkfile $TMPDIR/file2
> +ADS1000 aio-stress -a500  -o2 -r4 -f1
> +ADS1001 aio-stress -a500  -o2 -r8 -f1
> +ADS1002 aio-stress -a500  -o2 -r16 -f1
nit: s/[ ]+/ /g
(remove duplicate space)

> +++ b/runtest/ltp-aio-stress.part2
Both applies to this runtest level as well.

> --- a/testcases/kernel/io/ltp-aiodio/aio-stress.c
> +++ b/testcases/kernel/io/ltp-aiodio/aio-stress.c
> @@ -1,51 +1,30 @@
> +// SPDX-License-Identifier: GPL-2.0
I wonder if we can relicense to GPL-2.0-or-later if this is SUSE copyright.
I suppose we can't.
>  /*
>   * Copyright (c) 2004 SuSE, Inc.  All Rights Reserved.
> + *               Written by: Chris Mason <mason@suse.com>
> + * Copyright (C) 2021 SUSE LLC Andrea Cervesato <andrea.cervesato@suse.com>
> + */
> +
> +/*\
> + * [Description]
...
> - * io buffers are aligned in case you want to do raw io
> + * aio is done in a rotating loop. First file1.bin gets 8 requests, then
nit: s/io/IO/g s/aio/AIO/g

Kind regards,
Petr


More information about the ltp mailing list