Skip to content

io_uring: tw contention improvments

Dylan Yudaken io-uring 2 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 3 repliesApplied
  2. v1 RFC8 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- simplify comparison in handle_tw_list

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/8io_uring: remove priority tw list optimisationio_uring/io_uring.c io_uring/io_uring.h io_uring/rw.c +2 more+12 -700 replies
2/8io_uring: remove __io_req_task_work_addio_uring/io_uring.c+2 -90 replies
3/8io_uring: lockless task listinclude/linux/io_uring_types.h io_uring/io_uring.c io_uring/tctx.c +1 more+14 -350 replies
4/8io_uring: introduce llist helpersio_uring/io_uring.c+30 -00 replies
5/8io_uring: batch task_workio_uring/io_uring.c+13 -90 replies
6/8io_uring: move io_uring_get_opcode out of TP_printkinclude/trace/events/io_uring.h+35 -70 replies
7/8io_uring: add trace event for running task workinclude/trace/events/io_uring.h+30 -00 replies
8/8io_uring: trace task_work_runio_uring/io_uring.c+14 -50 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 for-next 0/8] io_uring: tw contention improvments

Task work currently uses a spin lock to guard task_list and task_running. Some use cases such as networking can trigger task_work_add from multiple threads all at once, which suffers from contention here.

This can be changed to use a lockless list which seems to have better performance. Running the micro benchmark in [1] I see 20% improvment in multithreaded task work add. It required removing the priority tw list optimisation, however it isn't clear how important that optimisation is. Additionally it has fairly easy to break semantics.

Patch 1-2 remove the priority tw list optimisation Patch 3-5 add lockless lists for task work Patch 6 fixes a bug I noticed in io_uring event tracing Patch 7-8 adds tracing for task_work_run

v2 changes:
- simplify comparison in handle_tw_list

Dylan Yudaken (8):
io_uring: remove priority tw list optimisation
io_uring: remove __io_req_task_work_add
io_uring: lockless task list
io_uring: introduce llist helpers
io_uring: batch task_work
io_uring: move io_uring_get_opcode out of TP_printk
io_uring: add trace event for running task work
io_uring: trace task_work_run

 include/linux/io_uring_types.h  |   2 +-
 include/trace/events/io_uring.h |  72 +++++++++++++--
 io_uring/io_uring.c             | 149 ++++++++++++--------------------
 io_uring/io_uring.h             |   1 -
 io_uring/rw.c                   |   2 +-
 io_uring/tctx.c                 |   4 +-
 io_uring/tctx.h                 |   7 +-
 7 files changed, 126 insertions(+), 111 deletions(-)

base-commit: 7b411672f03db4aa05dec1c96742fc02b99de3d4

Signature · 1 line
2.30.2