All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/5] io_uring: remove ring quiesce in io_uring_register
@ 2022-02-04 14:51 Usama Arif
  2022-02-04 14:51 ` [PATCH v6 1/5] io_uring: remove trace for eventfd Usama Arif
                   ` (6 more replies)
  0 siblings, 7 replies; 13+ messages in thread
From: Usama Arif @ 2022-02-04 14:51 UTC (permalink / raw)
  To: io-uring, axboe, asml.silence, linux-kernel; +Cc: fam.zheng, Usama Arif

Ring quiesce is currently used for registering/unregistering eventfds,
registering restrictions and enabling rings.

For opcodes relating to registering/unregistering eventfds, ring quiesce
can be avoided 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.

IORING_SETUP_R_DISABLED prevents submitting requests and
so there will be no requests until IORING_REGISTER_ENABLE_RINGS
is called. And IORING_REGISTER_RESTRICTIONS works only before
IORING_REGISTER_ENABLE_RINGS is called. Hence ring quiesce is
not needed for these opcodes.

---
v5->v6:
- Split removing ring quiesce completely from io_uring_register into
2 patches (Pavel Begunkov)
- Removed extra mutex while registering/unregistering eventfd as uring_lock
can be used (Pavel Begunkov)
- Move setting ctx->evfd to NULL from io_eventfd_put to before call_rcu
(Pavel Begunkov)

v4->v5:
- Remove ring quiesce completely from io_uring_register (Pavel Begunkov)
- Replaced rcu_barrier with unregistering flag (Jens Axboe)
- Created a faster check for ctx->io_ev_fd in io_eventfd_signal and cleaned up
io_eventfd_unregister (Jens Axboe)

v3->v4:
- Switch back to call_rcu and use rcu_barrier incase io_eventfd_register fails
to make sure all rcu callbacks have finished.

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 (5):
  io_uring: remove trace for eventfd
  io_uring: avoid ring quiesce while registering/unregistering eventfd
  io_uring: avoid ring quiesce while registering async eventfd
  io_uring: avoid ring quiesce while registering restrictions and
    enabling rings
  io_uring: remove ring quiesce for io_uring_register

 fs/io_uring.c                   | 179 +++++++++++++-------------------
 include/trace/events/io_uring.h |  13 +--
 2 files changed, 75 insertions(+), 117 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2022-07-15 18:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-04 14:51 [PATCH v6 0/5] io_uring: remove ring quiesce in io_uring_register Usama Arif
2022-02-04 14:51 ` [PATCH v6 1/5] io_uring: remove trace for eventfd Usama Arif
2022-02-04 14:51 ` [PATCH v6 2/5] io_uring: avoid ring quiesce while registering/unregistering eventfd Usama Arif
2022-02-04 14:51 ` [PATCH v6 3/5] io_uring: avoid ring quiesce while registering async eventfd Usama Arif
2022-02-04 14:51 ` [PATCH v6 4/5] io_uring: avoid ring quiesce while registering restrictions and enabling rings Usama Arif
2022-02-04 14:51 ` [PATCH v6 5/5] io_uring: remove ring quiesce for io_uring_register Usama Arif
2022-07-15 15:44   ` Michal Koutný
2022-07-15 16:00     ` Jens Axboe
2022-07-15 17:45       ` [PATCH] io_uring: Don't require reinitable percpu_ref Michal Koutný
2022-07-15 17:54         ` Roman Gushchin
2022-07-15 18:22         ` Jens Axboe
2022-02-04 15:53 ` [PATCH v6 0/5] io_uring: remove ring quiesce in io_uring_register Jens Axboe
2022-02-04 16:19 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.