public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH v3 0/3] io_uring: avoid ring quiesce in io_uring_register for eventfd opcodes
@ 2022-02-03 17:41 Usama Arif
  2022-02-03 17:41 ` [PATCH v3 1/3] io_uring: remove trace for eventfd Usama Arif
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Usama Arif @ 2022-02-03 17:41 UTC (permalink / raw)
  To: io-uring, axboe, asml.silence, linux-kernel; +Cc: fam.zheng, Usama Arif

This is done by creating a new RCU data structure (io_ev_fd) as part of
io_ring_ctx that holds the eventfd_ctx, with reads to the structure protected
by rcu_read_lock and writes (register/unregister calls) protected by a mutex.

With the above approach ring quiesce can be avoided which is much more
expensive then using RCU lock. On the system tested, io_uring_reigster with
IORING_REGISTER_EVENTFD takes less than 1ms with RCU lock, compared to 15ms
before with ring quiesce.

The first patch creates the RCU protected data structure and removes ring
quiesce for IORING_REGISTER_EVENTFD and IORING_UNREGISTER_EVENTFD.

The second patch builds on top of the first patch and removes ring quiesce
for IORING_REGISTER_EVENTFD_ASYNC.

---
v2->v3:
- Switched to using synchronize_rcu from call_rcu in io_eventfd_unregister

v1->v2:
- Added patch to remove eventfd from tracepoint (Patch 1) (Jens Axboe)
- Made the code of io_should_trigger_evfd as part of io_eventfd_signal (Jens Axboe)

Usama Arif (3):
  io_uring: remove trace for eventfd
  io_uring: avoid ring quiesce while registering/unregistering eventfd
  io_uring: avoid ring quiesce for IORING_REGISTER_EVENTFD_ASYNC

 fs/io_uring.c                   | 114 ++++++++++++++++++++++----------
 include/trace/events/io_uring.h |  13 ++--
 2 files changed, 83 insertions(+), 44 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2022-02-03 23:26 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-03 17:41 [PATCH v3 0/3] io_uring: avoid ring quiesce in io_uring_register for eventfd opcodes Usama Arif
2022-02-03 17:41 ` [PATCH v3 1/3] io_uring: remove trace for eventfd Usama Arif
2022-02-03 17:41 ` [PATCH v3 2/3] io_uring: avoid ring quiesce while registering/unregistering eventfd Usama Arif
2022-02-03 17:56   ` Jens Axboe
2022-02-03 18:26     ` [External] " Usama Arif
2022-02-03 18:29       ` Jens Axboe
2022-02-03 19:00         ` Pavel Begunkov
2022-02-03 19:06           ` Jens Axboe
2022-02-03 19:43             ` Pavel Begunkov
2022-02-03 22:18               ` Jens Axboe
2022-02-03 19:54             ` Usama Arif
2022-02-03 21:47               ` Pavel Begunkov
2022-02-03 22:16                 ` Jens Axboe
2022-02-03 23:21                   ` Pavel Begunkov
2022-02-03 22:02               ` Pavel Begunkov
2022-02-03 17:41 ` [PATCH v3 3/3] io_uring: avoid ring quiesce for IORING_REGISTER_EVENTFD_ASYNC Usama Arif

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