diff options
author | Usama Arif <usama.arif@bytedance.com> | 2022-02-04 14:51:14 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-03-10 06:32:49 -0700 |
commit | 77bc59b498174ea4f120d477d2cd0cf90fc58235 (patch) | |
tree | ac4889e6fbe3c93fe68cbee68055eee89fe9b179 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 2757be22c0f4c06d359f802fa1fc57286fa26975 (diff) |
io_uring: avoid ring quiesce while registering/unregistering eventfd
This is done by creating a new RCU data structure (io_ev_fd) as part of
io_ring_ctx that holds the eventfd_ctx.
The function io_eventfd_signal is executed under rcu_read_lock with a
single rcu_dereference to io_ev_fd so that if another thread unregisters
the eventfd while io_eventfd_signal is still being executed, the
eventfd_signal for which io_eventfd_signal was called completes
successfully.
The process of registering/unregistering eventfd is already done under
uring_lock so multiple threads won't enter a race condition while
registering/unregistering eventfd.
With the above approach ring quiesce can be avoided which is much more
expensive then using RCU lock. On the system tested, io_uring_register
with IORING_REGISTER_EVENTFD takes less than 1ms with RCU lock, compared
to 15ms before with ring quiesce.
Signed-off-by: Usama Arif <usama.arif@bytedance.com>
Link: https://lore.kernel.org/r/20220204145117.1186568-3-usama.arif@bytedance.com
[axboe: long line fixups]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions