diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-12-09 11:22:50 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-01-20 17:03:50 -0700 |
commit | 05f3fb3c5397524feae2e73ee8e150a9090a7da2 (patch) | |
tree | 12408872bb2940e587749e2a80a9ef084eaed869 /fs/stat.c | |
parent | b5dba59e0cf7e2cc4d3b3b1ac5fe81ddf21959eb (diff) |
io_uring: avoid ring quiesce for fixed file set unregister and update
We currently fully quiesce the ring before an unregister or update of
the fixed fileset. This is very expensive, and we can be a bit smarter
about this.
Add a percpu refcount for the file tables as a whole. Grab a percpu ref
when we use a registered file, and put it on completion. This is cheap
to do. Upon removal of a file from a set, switch the ref count to atomic
mode. When we hit zero ref on the completion side, then we know we can
drop the previously registered files. When the old files have been
dropped, switch the ref back to percpu mode for normal operation.
Since there's a period between doing the update and the kernel being
done with it, add a IORING_OP_FILES_UPDATE opcode that can perform the
same action. The application knows the update has completed when it gets
the CQE for it. Between doing the update and receiving this completion,
the application must continue to use the unregistered fd if submitting
IO on this particular file.
This takes the runtime of test/file-register from liburing from 14s to
about 0.7s.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/stat.c')
0 files changed, 0 insertions, 0 deletions