All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Cervesato via ltp <ltp@lists.linux.it>
To: Cyril Hrubis <chrubis@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v6] Refactor aiocp using new LTP API
Date: Wed, 10 Aug 2022 14:28:27 +0200	[thread overview]
Message-ID: <ade189ba-4211-99a8-d5e6-c99b1950e21b@suse.com> (raw)
In-Reply-To: <YvOKbt1urOeVwQ57@yuki>

Hi Cyril,

On 8/10/22 12:37, Cyril Hrubis wrote:
> Hi!
> The runtime changes do not unfortunatelly work as expected.
>
> First of all we have to check for the runtime in the function that
> prepares the file with a random data, since that is quite slow as well.
> Since that is done from the test setup it actually runs in a separate
> runtime window so I would do just:
>
> diff --git a/testcases/kernel/io/ltp-aiodio/aiocp.c b/testcases/kernel/io/ltp-aiodio/aiocp.c
> index 816407284..2b34d8bbe 100644
> --- a/testcases/kernel/io/ltp-aiodio/aiocp.c
> +++ b/testcases/kernel/io/ltp-aiodio/aiocp.c
> @@ -66,6 +66,9 @@ static void fill_with_rand_data(int fd, long long size)
>          srand(time(NULL));
>
>          while (i < size) {
> +               if (!tst_remaining_runtime())
> +                       tst_brk(TCONF, "Out of runtime!");
> +
>                  for (j = 0; j < bufsize; j++) {
>                          buf[j] = (rand() % (upper - lower + 1)) + lower;
>                          i++;
>
> Also the rand() function is way to slow, it's almost 10x faster for
> 500MB buffer if you move the buffer intialization out of the loop, i.e.
> initialize the buffer with random data once and then write it over and
> over.
Yes, we can reduce the amount of time to generate file (especially if 
it's really big), but I wouldn't
introduce any repetition because we would like to check that file has 
been copied properly during
callbacks which are asynchronous by definition.
>
> Then again we would have to check in the async_run() otherwise we will
> keep pushing new read request over and over until the queue has
> finished.
>
> Lastly we silently skip the check and report PASS when we are out of
> runtime, that's not nice. I would be inclined to report TCONF if we end
> up out of time before we managed to check that the data was copied
> correctly. That wouldn't provide people with a false security.
>


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

  reply	other threads:[~2022-08-10 12:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10  9:28 [LTP] [PATCH v6] Refactor aiocp using new LTP API Andrea Cervesato via ltp
2022-08-10 10:37 ` Cyril Hrubis
2022-08-10 12:28   ` Andrea Cervesato via ltp [this message]
2022-08-10 12:37     ` Cyril Hrubis
2022-08-11  9:42       ` Petr Vorel
2022-08-11 10:25         ` Cyril Hrubis

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=ade189ba-4211-99a8-d5e6-c99b1950e21b@suse.com \
    --to=ltp@lists.linux.it \
    --cc=andrea.cervesato@suse.com \
    --cc=chrubis@suse.cz \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.