single-issuer and poll benchmark
cover single-issuer and poll benchmark
Add some tests to check the kernel enforcing single-issuer right, and add a simple poll benchmark, might be useful if we do poll changes.
Pavel Begunkov (3):
io_uring: update headers with IORING_SETUP_SINGLE_ISSUER
examples: add a simple single-shot poll benchmark
tests: test IORING_SETUP_SINGLE_ISSUER
examples/Makefile | 3 +- examples/poll-bench.c | 108 ++++++++++++++++++++ src/include/liburing/io_uring.h | 5 +- test/Makefile | 1 + test/single-issuer.c | 173 ++++++++++++++++++++++++++++++++ 5 files changed, 288 insertions(+), 2 deletions(-) create mode 100644 examples/poll-bench.c create mode 100644 test/single-issuer.c
Signature · 1 line
2.36.1
PATCH 1/3 io_uring: update headers with IORING_SETUP_SINGLE_ISSUER
--- src/include/liburing/io_uring.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
src/include/liburing/io_uring.h +4 -1
@@ -137,9 +137,12 @@ enum {* IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN. */ #define IORING_SETUP_TASKRUN_FLAG (1U << 9) -#define IORING_SETUP_SQE128 (1U << 10)/* SQEs are 128 byte */ #define IORING_SETUP_CQE32 (1U << 11)/* CQEs are 32 byte */ +/* +* Only one task is allowed to submit requests +*/ +#define IORING_SETUP_SINGLE_ISSUER (1U << 12)enum io_uring_op {IORING_OP_NOP ,
Signature · 1 line
2.36.1
Re: [PATCH liburing 1/3] io_uring: update headers with IORING_SETUP_SINGLE_ISSUER
Quoted 1 line · Pavel Begunkov
Signed-off-by Pavel Begunkov <[email protected]>
Something did go wrong here... just ignore it,
the v2 sent yesterday is up to date.
Quoted 22 lines
--- src/include/liburing/io_uring.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)src/include/liburing/io_uring.h +4
-1@@ -137,9 +137,12 @@ enum {* IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN. */ #define IORING_SETUP_TASKRUN_FLAG (1U << 9) -#define IORING_SETUP_SQE128 (1U << 10)/* SQEs are 128 byte */ #define IORING_SETUP_CQE32 (1U << 11)/* CQEs are 32 byte */ +/* +* Only one task is allowed to submit requests +*/ +#define IORING_SETUP_SINGLE_ISSUER (1U << 12)enum io_uring_op {IORING_OP_NOP ,
Signature · 1 line
Pavel Begunkov
Re: [PATCH liburing 1/3] io_uring: update headers with IORING_SETUP_SINGLE_ISSUER
Quoted 5 lines · Pavel Begunkov
Quoted 1 line · Pavel Begunkov
Signed-off-by Pavel Begunkov <[email protected]>Something did go wrong here... just ignore it,
the v2 sent yesterday is up to date.
That goes to the whole series
(missing the cover-letter in the mailbox)
Quoted 23 lines
Quoted 22 lines
---
src/include/liburing/io_uring.h| 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)src/include/liburing/io_uring.h +4
-1@@ -137,9 +137,12 @@ enum {* IORING_SQ_TASKRUN in the sq ring flags. Not valid with COOP_TASKRUN. */ #define IORING_SETUP_TASKRUN_FLAG (1U << 9) - #define IORING_SETUP_SQE128 (1U << 10) /* SQEs are 128 byte */ #define IORING_SETUP_CQE32 (1U << 11) /* CQEs are 32 byte */ +/* +* Only one task is allowed to submit requests +*/ +#define IORING_SETUP_SINGLE_ISSUER (1U << 12) enum io_uring_op { IORING_OP_NOP,
Signature · 1 line
Pavel Begunkov
PATCH 2/3 examples: add a simple single-shot poll benchmark
In reply to Pavel Begunkov--- examples/Makefile | 3 +- examples/poll-bench.c | 108 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 examples/poll-bench.c
examples/Makefile +2 -1
@@ -13,7 +13,8 @@ endif example_srcs := \ io_uring-cp.c \ io_uring-test.c \ - link-cp.c + link-cp.c \ + poll-bench.c all_targets :=
examples/poll-bench.c new file +108 -0
108 lines not on this page · raw message
Signature · 1 line
2.36.1
Re: [PATCH liburing 2/3] examples: add a simple single-shot poll benchmark
examples/poll-bench.c line 41
Quoted 13 lines · Pavel Begunkov
examples/poll-bench.c new file +13
-0+int main (void ) +{ +unsigned long tstop; +unsigned long nr_reqs =0 ; +struct io_uring_cqe *cqe; +struct io_uring_sqe *sqe; +struct io_uring ring; +int pipe1[2 ]; +int ret, i, qd =128 ; + +if (argc >1 ) +return 0 ; +
Hi Pavel,
I am testing this and it doesn't compile, the main(void) needs fixing.
```
poll-bench.c: In function ‘main’:
poll-bench.c:39:13: error: ‘argc’ undeclared (first use in this function)
39 | if (argc > 1)
| ^~~~
poll-bench.c:39:13: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [Makefile:34: poll-bench] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/ammarfaizi2/app/liburing/examples'
make: *** [Makefile:12: all] Error 2
```Signature · 1 line
Ammar Faizi
Re: [PATCH liburing 2/3] examples: add a simple single-shot poll benchmark
Quoted 17 lines · Ammar Faizi
examples/poll-bench.c line 41
Quoted 13 lines · Pavel Begunkov
examples/poll-bench.c new file +13
-0+int main (void ) +{ + unsigned long tstop; + unsigned long nr_reqs = 0; + struct io_uring_cqe *cqe; + struct io_uring_sqe *sqe; + struct io_uring ring; + int pipe1[2]; + int ret, i, qd = 128; + + if (argc > 1) + return 0; +Hi Pavel,
Quoted 1 line
I am testing this and it doesn't compile, the main(void) needs fixing.
Indeed, some of final changes escaped git add. Thanks Ammar
Quoted 13 lines
``` poll-bench.c: In function ‘main’: poll-bench.c:39:13: error: ‘argc’ undeclared (first use in this function) 39 | if (argc > 1) | ^~~~ poll-bench.c:39:13: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [Makefile:34: poll-bench] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory '/home/ammarfaizi2/app/liburing/examples' make: *** [Makefile:12: all] Error 2 ```
Signature · 1 line
Pavel Begunkov
PATCH 3/3 tests: test IORING_SETUP_SINGLE_ISSUER
In reply to Pavel Begunkov--- test/Makefile | 1 + test/single-issuer.c | 173 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 test/single-issuer.c
test/Makefile +1 -0
@@ -169,6 +169,7 @@ test_srcs := \ wakeup-hang.c \ xattr.c \ skip-cqe.c \ + single-issuer.c \ # EOL
test/single-issuer.c new file +173 -0
173 lines not on this page · raw message
Signature · 1 line
2.36.1