From: Bui Quang Minh <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>,
Pavel Begunkov <[email protected]>,
[email protected],
Bui Quang Minh <[email protected]>
Subject: [RFC PATCH 0/2] Batch free work in io-wq
Date: Fri, 21 Feb 2025 11:19:24 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
When benchmarking a echo server using io_uring with force async to
spawn io workers and without IORING_SETUP_DEFER_TASKRUN, I saw a small
contention in tctx->task_list in the io_worker_handle_work loop. After
handling work, we call free_work, which will add a task work to the
shared tctx->task_list. The idea of this patchset is that each io worker
will queue the freed works in its local list and batches multiple free
work in one call when the number of freed works reaches
IO_REQ_ALLOC_BATCH.
=========
Benchmark
=========
Setup:
- Host: Intel(R) Core(TM) i7-10750H CPU with 12 CPUs
- Guest: Qemu KVM with 4 vCPUs, multiqueues virtio-net (each vCPUs has
its own tx/rx pair)
- Test source code: https://github.com/minhbq-99/toy-echo-server
In guest machine, run the `./io_uring_server -a` (number of unbound io
worker is limited to number of CPUs, 4 in the benchmark environment).
In host machine, run `for i in $(seq 1 10); do ./client --client 8
--packet.size 2000 --duration 30s -ip 192.168.31.3; done;`. This will
create 8 TCP client sockets.
Result:
- Before: 55,885.56 +- 1,782.51 req/s
- After: 59,926.25 +- 312.60 req/s (+7.23%)
Though the result shows the difference is statistically significant, the
improvement is quite small. I really appreciate any further suggestions.
Thanks,
Quang Minh.
Bui Quang Minh (2):
io_uring: make io_req_normal_work_add accept a list of requests
io_uring/io-wq: try to batch multiple free work
io_uring/io-wq.c | 62 +++++++++++++++++++++++++++++++++++++++++++--
io_uring/io-wq.h | 4 ++-
io_uring/io_uring.c | 36 +++++++++++++++++++-------
io_uring/io_uring.h | 8 +++++-
4 files changed, 97 insertions(+), 13 deletions(-)
--
2.43.0
next reply other threads:[~2025-02-21 4:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-21 4:19 Bui Quang Minh [this message]
2025-02-21 4:19 ` [RFC PATCH 1/2] io_uring: make io_req_normal_work_add accept a list of requests Bui Quang Minh
2025-02-21 4:19 ` [RFC PATCH 2/2] io_uring/io-wq: try to batch multiple free work Bui Quang Minh
2025-02-21 12:44 ` Pavel Begunkov
2025-02-21 14:45 ` Bui Quang Minh
2025-02-21 14:52 ` Bui Quang Minh
2025-02-21 15:28 ` Pavel Begunkov
2025-02-21 15:41 ` Pavel Begunkov
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