Linux io-uring development
 help / color / mirror / Atom feed
* [PATCHSET v2] Add lockless MPSC FIFO queue for task work
@ 2026-06-12  2:48 Jens Axboe
  2026-06-12  2:48 ` [PATCH 1/6] io_uring: grab RCU read lock marking task run Jens Axboe
                   ` (5 more replies)
  0 siblings, 6 replies; 22+ messages in thread
From: Jens Axboe @ 2026-06-12  2:48 UTC (permalink / raw)
  To: io-uring; +Cc: dvyukov, csander, krisman

Hi,

For v1, see here:

https://lore.kernel.org/io-uring/20260611160553.1486640-1-axboe@kernel.dk/

v2 moves the regular task_work over to mpscq as well, and adds a few
optimizations on top of v1. See the changes section for more details.

Can also be found in a git tree here:

https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux.git/log/?h=io_uring-tw-mpscq

Changes since v1:
- Add patches moving !defer task_work to mpscq as well.
- Get rid of ->cq_wait_added and the associated atomics on that. Have
  waiter set ->cq_wait_nr and just count down from that. Removes another
  atomic in local work additions, and eliminates the need for the
  atomic_try_cmpxchg() for the faster lazy wakes.
- Get rid of RCU read lock for local work additions (Caleb)
- Cleanup up mpscq API a bit (Caleb)
- Correct mpscq comment (Caleb)

 include/linux/io_uring_types.h |  39 ++++-
 io_uring/cancel.c              |   2 -
 io_uring/io_uring.c            |   9 +-
 io_uring/mpscq.h               | 118 +++++++++++++
 io_uring/sqpoll.c              |  30 ++--
 io_uring/tctx.c                |   3 +-
 io_uring/tw.c                  | 307 +++++++++++++++------------------
 io_uring/tw.h                  |  11 +-
 io_uring/wait.c                |   2 +-
 io_uring/wait.h                |  10 +-
 10 files changed, 316 insertions(+), 215 deletions(-)

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2026-06-16  0:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-12  2:48 [PATCHSET v2] Add lockless MPSC FIFO queue for task work Jens Axboe
2026-06-12  2:48 ` [PATCH 1/6] io_uring: grab RCU read lock marking task run Jens Axboe
2026-06-13  2:27   ` Caleb Sander Mateos
2026-06-12  2:48 ` [PATCH 2/6] io_uring/mpscq: add lockless multi-producer, single-consumer FIFO queue Jens Axboe
2026-06-13  2:40   ` Caleb Sander Mateos
2026-06-13 12:22     ` Jens Axboe
2026-06-12  2:48 ` [PATCH 3/6] io_uring: switch local task_work to a mpscq Jens Axboe
2026-06-12  3:20   ` Caleb Sander Mateos
2026-06-12 12:23     ` Jens Axboe
2026-06-12  2:48 ` [PATCH 4/6] io_uring: switch normal " Jens Axboe
2026-06-12 18:59   ` Caleb Sander Mateos
2026-06-12 19:37     ` Jens Axboe
2026-06-13  2:26       ` Caleb Sander Mateos
2026-06-13 12:08         ` Jens Axboe
2026-06-15 18:33           ` Caleb Sander Mateos
2026-06-15 18:47             ` Jens Axboe
2026-06-15 20:04               ` Jens Axboe
2026-06-15 20:40                 ` Caleb Sander Mateos
2026-06-15 21:51                   ` Jens Axboe
2026-06-16  0:22                     ` Caleb Sander Mateos
2026-06-12  2:48 ` [PATCH 5/6] io_uring: run the tctx task_work fallback directly Jens Axboe
2026-06-12  2:48 ` [PATCH 6/6] io_uring: remove the per-ctx fallback task_work machinery Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox