From: Dylan Yudaken <[email protected]>
To: Jens Axboe <[email protected]>, Pavel Begunkov <[email protected]>
Cc: <[email protected]>, <[email protected]>,
Dylan Yudaken <[email protected]>
Subject: [PATCH liburing 2/2] run link_drain test with defer_taskrun too
Date: Fri, 27 Jan 2023 03:11:33 -0800 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Defer_taskrun seems to expose odd codepaths, so also run link_drain tests
using it.
Signed-off-by: Dylan Yudaken <[email protected]>
---
test/link_drain.c | 34 ++++++++++++++++++++++++++++++----
1 file changed, 30 insertions(+), 4 deletions(-)
diff --git a/test/link_drain.c b/test/link_drain.c
index 1a50c10d181d..86b0aa8db7fe 100644
--- a/test/link_drain.c
+++ b/test/link_drain.c
@@ -198,15 +198,17 @@ err:
}
-int main(int argc, char *argv[])
+static int test_drain(bool defer)
{
struct io_uring ring;
int i, ret;
+ unsigned int flags = 0;
- if (argc > 1)
- return 0;
+ if (defer)
+ flags = IORING_SETUP_SINGLE_ISSUER |
+ IORING_SETUP_DEFER_TASKRUN;
- ret = io_uring_queue_init(100, &ring, 0);
+ ret = io_uring_queue_init(100, &ring, flags);
if (ret) {
printf("ring setup failed\n");
return 1;
@@ -227,3 +229,27 @@ int main(int argc, char *argv[])
return ret;
}
+
+int main(int argc, char *argv[])
+{
+ int ret;
+
+ if (argc > 1)
+ return T_EXIT_SKIP;
+
+ ret = test_drain(false);
+ if (ret) {
+ fprintf(stderr, "test_drain(false) failed\n");
+ return T_EXIT_FAIL;
+ }
+
+ if (t_probe_defer_taskrun()) {
+ ret = test_drain(true);
+ if (ret) {
+ fprintf(stderr, "test_drain(true) failed\n");
+ return T_EXIT_FAIL;
+ }
+ }
+
+ return T_EXIT_PASS;
+}
--
2.30.2
next prev parent reply other threads:[~2023-01-27 11:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-27 11:11 [PATCH liburing 0/2] liburing: patches for drain bug Dylan Yudaken
2023-01-27 11:11 ` [PATCH liburing 1/2] add a test using drain with IORING_SETUP_DEFER_TASKRUN Dylan Yudaken
2023-01-27 11:11 ` Dylan Yudaken [this message]
2023-01-27 13:46 ` [PATCH liburing 0/2] liburing: patches for drain bug Jens Axboe
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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