public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: Linux Test Project <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH] io: fix really slow dio_sparse on certain systems
Date: Fri, 23 Jan 2026 18:56:29 +0100	[thread overview]
Message-ID: <20260123175629.GA358728@pevik> (raw)
In-Reply-To: <20260123-fix_dio_sparse_slow-v1-1-65bd0dc0d52f@suse.com>

Hi Andrea,

> The reason why dio_sparse is happening to be slow on certain systems is
> that, if data buffering is slow, we run more buffered read() for one
> single dio write(). This slows down the whole test, because for each
> read() we always need to move data from kernel space to user space.

> Create a READ_BUFFER_SIZE variable inside the common.h header and use
> it to define the write buffer size.

LGTM. IMHO good for a release.

Kind regards,
Petr

> Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
> ---
>  testcases/kernel/io/ltp-aiodio/common.h     | 6 ++++--
>  testcases/kernel/io/ltp-aiodio/dio_sparse.c | 2 +-
>  2 files changed, 5 insertions(+), 3 deletions(-)

> diff --git a/testcases/kernel/io/ltp-aiodio/common.h b/testcases/kernel/io/ltp-aiodio/common.h
> index 9a2d2716661651adf40c635ac516cc70068c9393..d3f05a3c1e75cd4baa629cbce1872729a0d641c6 100644
> --- a/testcases/kernel/io/ltp-aiodio/common.h
> +++ b/testcases/kernel/io/ltp-aiodio/common.h
> @@ -9,6 +9,8 @@
>  #include <stdlib.h>
>  #include "tst_test.h"

> +#define READ_BUFFER_SIZE 4096
> +
>  static inline char *check_zero(char *buf, int size)
>  {
>  	char *p;
> @@ -57,7 +59,7 @@ static inline void io_append(const char *path, char pattern, int flags, size_t b

>  static inline void io_read(const char *filename, int filesize, volatile int *run_child)
>  {
> -	char buff[4096];
> +	char buff[READ_BUFFER_SIZE];
>  	int fd;
>  	int i;
>  	int r;
> @@ -102,7 +104,7 @@ exit:

>  static inline void io_read_eof(const char *filename, volatile int *run_child)
>  {
> -	char buff[4096];
> +	char buff[READ_BUFFER_SIZE];
>  	int fd;
>  	int r;

> diff --git a/testcases/kernel/io/ltp-aiodio/dio_sparse.c b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
> index c87e5ab1aca7c8910f76ee87f86b561f548d4cdf..d858340bf9a707fb019e82c644da7f355ad0effd 100644
> --- a/testcases/kernel/io/ltp-aiodio/dio_sparse.c
> +++ b/testcases/kernel/io/ltp-aiodio/dio_sparse.c
> @@ -32,7 +32,7 @@ static char *str_filesize;
>  static char *str_offset;

>  static int numchildren = 16;
> -static long long writesize = 1024;
> +static long long writesize = READ_BUFFER_SIZE;
>  static long long filesize = 100 * 1024 * 1024;
>  static long long offset = 0;
>  static long long alignment;

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2026-01-23 17:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 13:16 [LTP] [PATCH] io: fix really slow dio_sparse on certain systems Andrea Cervesato
2026-01-23 17:56 ` Petr Vorel [this message]
2026-01-26  8:39   ` Andrea Cervesato via ltp
2026-01-26 10:07     ` Petr Vorel
2026-01-26 11:10       ` Andrea Cervesato via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260123175629.GA358728@pevik \
    --to=pvorel@suse.cz \
    --cc=andrea.cervesato@suse.de \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox