single-issuer and poll benchmark
v2 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.
v2:
remove copy-pasted test comments
fix poll-bench 'argc' build problem
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 | 101 +++++++++++++++++++ src/include/liburing/io_uring.h | 5 +- test/Makefile | 1 + test/single-issuer.c | 169 ++++++++++++++++++++++++++++++++ 5 files changed, 277 insertions(+), 2 deletions(-) create mode 100644 examples/poll-bench.c create mode 100644 test/single-issuer.c
Signature · 1 line
2.36.1
PATCH v2 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
PATCH v2 2/3 examples: add a simple single-shot poll benchmark
In reply to Pavel Begunkov--- examples/Makefile | 3 +- examples/poll-bench.c | 101 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 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 +101 -0
101 lines not on this page · raw message
Signature · 1 line
2.36.1
PATCH v2 3/3 tests: test IORING_SETUP_SINGLE_ISSUER
In reply to Pavel Begunkov--- test/Makefile | 1 + test/single-issuer.c | 169 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 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 +169 -0
169 lines not on this page · raw message
Signature · 1 line
2.36.1
Jens Axboe
maintainerQuoted 2 lines · Pavel Begunkov
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.
Should we add a benchmark/ or something directory rather than use examples/ ?
I know Dylan was looking at that at one point. I don't feel too strongly, as long as it doesn't go into test/.
Signature · 1 line
Jens Axboe
Quoted 9 lines · Jens Axboe
Quoted 2 lines · Pavel Begunkov
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.
Should we add a benchmark/ or something directory rather than use examples/ ?
I know Dylan was looking at that at one point. I don't feel too strongly, as long as it doesn't go into test/.
I don't care much myself, I can respin it once (if) the kernel side is queued.
Signature · 1 line
Pavel Begunkov
Jens Axboe
maintainerQuoted 5 lines · Pavel Begunkov
Quoted 4 lines · Jens Axboe
Quoted 2 lines · Pavel Begunkov
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.
Quoted 8 lines
Quoted 5 lines
Should we add a benchmark/ or something directory rather than use examples/ ?
I know Dylan was looking at that at one point. I don't feel too strongly, as long as it doesn't go into test/.
I don't care much myself, I can respin it once (if) the kernel side is queued.
I'm leaning towards just using examples/ - but maybe Dylan had some reasoning for the new directory. CC'ed.
Signature · 1 line
Jens Axboe
Quoted 11 lines · Jens Axboe
Quoted 10 lines · Pavel Begunkov
Quoted 9 lines · Jens Axboe
Quoted 4 lines · Pavel Begunkov
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.Should we add a benchmark/ or something directory rather than use examples/ ?
Quoted 9 lines
Quoted 5 lines
Quoted 2 lines
I know Dylan was looking at that at one point. I don't feel too strongly, as long as it doesn't go into test/.
I don't care much myself, I can respin it once (if) the kernel side is queued.
I'm leaning towards just using examples/ - but maybe Dylan had some reasoning for the new directory. CC'ed.
I wanted to have some common framework for benchmarks to make it easy to write new ones and get some nice numbers. In that case it would make sense for them to be in one place.
But I haven't finished it yet, so probably for now examples/ is best and if/when I finish it I can port these over.
Quoted 18 lines · Dylan Yudaken
Quoted 17 lines · Jens Axboe
Quoted 15 lines · Pavel Begunkov
Quoted 11 lines · Jens Axboe
Quoted 4 lines · Pavel Begunkov
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.Should we add a benchmark/ or something directory rather than use examples/ ?
I know Dylan was looking at that at one point. I don't feel too strongly, as long as it doesn't go into test/.
I don't care much myself, I can respin it once (if) the kernel side is queued.
Quoted 7 lines
Quoted 3 lines
I'm leaning towards just using examples/ - but maybe Dylan had some reasoning for the new directory. CC'ed.
I wanted to have some common framework for benchmarks to make it easy to write new ones and get some nice numbers. In that case it would make sense for them to be in one place.
This sounds great, it's really nice to have a series of standard performance tests rather than temporary tests created along with new kernel patches. A framework is something nicer. Actually there are people doing this though just a simple one, FWIW:
https://gitee.com/anolis/perf-test-for-io_uring
Quoted 4 lines
But I haven't finished it yet, so probably for now examples/ is best and if/when I finish it I can port these over.