[LTP] [PATCH v1] Reduce default number of threads in dio_sparse.c

Cyril Hrubis chrubis@suse.cz
Tue Jan 18 14:02:06 CET 2022


Hi!
> Initialized options out of setup and reduced default number of
> threads from 1000 to 16

I've added a bit more verbose descriptioin here about how the default
has changed and pushed, thanks.

> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.de>
> ---
>  testcases/kernel/io/ltp-aiodio/dio_sparse.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/testcases/kernel/io/ltp-aiodio/dio_sparse.c b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
> index 929adbfba..8635df82f 100644
> --- a/testcases/kernel/io/ltp-aiodio/dio_sparse.c
> +++ b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
> @@ -33,11 +33,11 @@ static char *str_writesize;
>  static char *str_filesize;
>  static char *str_offset;
>  
> -static int numchildren;
> -static long long writesize;
> -static long long filesize;
> -static long long offset;
> -static long long alignment;
> +static int numchildren = 16;
> +static long long writesize = 1024;
> +static long long filesize = 100 * 1024 * 1024;
> +static long long offset = 0;
> +static long long alignment = 512;

I've also removed this assignment since alignment is initialized
unconditionally.

>  static void dio_sparse(int fd, int align, long long fs, int ws, long long off)
>  {
> @@ -60,12 +60,6 @@ static void setup(void)
>  {
>  	struct stat sb;
>  
> -	numchildren = 1000;
> -	writesize = 1024;
> -	filesize = 100 * 1024 * 1024;
> -	offset = 0;
> -	alignment = 512;
> -
>  	if (tst_parse_int(str_numchildren, &numchildren, 1, INT_MAX))
>  		tst_brk(TBROK, "Invalid number of children '%s'", str_numchildren);
>  
> @@ -129,7 +123,7 @@ static struct tst_test test = {
>  	.needs_tmpdir = 1,
>  	.forks_child = 1,
>  	.options = (struct tst_option[]) {
> -		{"n:", &str_numchildren, "Number of threads (default 1000)"},
> +		{"n:", &str_numchildren, "Number of threads (default 16)"},
>  		{"w:", &str_writesize, "Size of writing blocks (default 1K)"},
>  		{"s:", &str_filesize, "Size of file (default 100M)"},
>  		{"o:", &str_offset, "File offset (default 0)"},
> -- 
> 2.34.1
> 
> 
> -- 
> Mailing list info: https://lists.linux.it/listinfo/ltp

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list