io_uring: assign new io_identity for task if members have changed

This avoids doing a copy for each new async IO, if some parts of the
io_identity has changed. We avoid reference counting for the normal
fast path of nothing ever changing.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2020-10-15 17:38:03 -06:00
parent 5c3462cfd1
commit 500a373d73
2 changed files with 17 additions and 5 deletions

View File

@@ -24,7 +24,8 @@ struct io_uring_task {
struct wait_queue_head wait;
struct file *last;
atomic_long_t req_issue;
struct io_identity identity;
struct io_identity __identity;
struct io_identity *identity;
/* completion side */
bool in_idle ____cacheline_aligned_in_smp;