From: Cyril Hrubis <chrubis@suse.cz>
To: Andrea Cervesato <andrea.cervesato@suse.de>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4] Refactoring aiodio_sparse.c using LTP API
Date: Tue, 22 Feb 2022 13:46:23 +0100 [thread overview]
Message-ID: <YhTbHxQMmeuse/Wf@yuki> (raw)
In-Reply-To: <20220201091938.23362-1-andrea.cervesato@suse.de>
Hi!
Pushed with a few changes, thanks.
I've mainly added a few elements to the tst_test structure to match the
fixes we did for dio_sparse.c and also removed a few obvious comments.
diff --git a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
index 33a25a28c..2aa5662bb 100644
--- a/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
+++ b/testcases/kernel/io/ltp-aiodio/aiodio_sparse.c
@@ -35,10 +35,10 @@ static char *str_writesize;
static char *str_filesize;
static char *str_numaio;
-static int numchildren = 1000;
+static int numchildren = 16;
static long long writesize = 1024;
static long long filesize = 100 * 1024 * 1024;
-static long long alignment = 512;
+static long long alignment;
static int numaio = 16;
static void check_event(struct io_event event)
@@ -76,9 +76,6 @@ static void aiodio_sparse(char *filename, long long align, long long ws,
for (i = 0; i < naio; i++)
iocbs[i] = iocb + i;
- /*
- * allocate the iocbs array and iocbs with buffers
- */
offset = 0;
for (i = 0; i < naio; i++) {
void *bufptr;
@@ -89,16 +86,10 @@ static void aiodio_sparse(char *filename, long long align, long long ws,
offset += ws;
}
- /*
- * start the 1st naio write requests
- */
w = io_submit(myctx, naio, iocbs);
if (w < 0)
tst_brk(TBROK, "io_submit: %s", tst_strerrno(-w));
- /*
- * As AIO requests finish, keep issuing more AIO until done.
- */
aio_inflight = naio;
while (offset < fs) {
@@ -129,9 +120,6 @@ static void aiodio_sparse(char *filename, long long align, long long ws,
aio_inflight++;
}
- /*
- * wait for AIO requests in flight.
- */
while (aio_inflight > 0) {
int n;
@@ -175,8 +163,7 @@ static void setup(void)
if ((numaio * writesize) > filesize) {
numaio = filesize / writesize;
tst_res(TINFO,
- "Numbers of AIO have been reduced to %d so we fit "
- "filesize",
+ "Numbers of AIO have been reduced to %d so we fit filesize",
numaio);
}
@@ -192,8 +179,10 @@ static void setup(void)
static void cleanup(void)
{
- *run_child = 0;
- SAFE_MUNMAP(run_child, sizeof(int));
+ if (run_child) {
+ *run_child = 0;
+ SAFE_MUNMAP(run_child, sizeof(int));
+ }
}
static void run(void)
@@ -230,12 +219,17 @@ 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_numaio, "Number of AIO control blocks (default 16)"},
{},
},
+ .skip_filesystems = (const char *[]) {
+ "tmpfs",
+ NULL
+ },
+ .timeout = 1800,
};
#else
TST_TEST_TCONF("test requires libaio and its development packages");
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
prev parent reply other threads:[~2022-02-22 12:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-01 9:19 [LTP] [PATCH v4] Refactoring aiodio_sparse.c using LTP API Andrea Cervesato
2022-02-22 12:46 ` Cyril Hrubis [this message]
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=YhTbHxQMmeuse/Wf@yuki \
--to=chrubis@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