All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v6] Refactor aiocp using new LTP API
Date: Wed, 10 Aug 2022 12:37:34 +0200	[thread overview]
Message-ID: <YvOKbt1urOeVwQ57@yuki> (raw)
In-Reply-To: <20220810092804.5771-1-andrea.cervesato@suse.com>

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.

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.

-- 
Cyril Hrubis
chrubis@suse.cz

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

  reply	other threads:[~2022-08-10 10:36 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 [this message]
2022-08-10 12:28   ` Andrea Cervesato via ltp
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=YvOKbt1urOeVwQ57@yuki \
    --to=chrubis@suse.cz \
    --cc=andrea.cervesato@suse.com \
    --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 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.