summaryrefslogtreecommitdiff
path: root/io_uring/rw.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-03-18 16:31:44 -0600
committerJens Axboe <axboe@kernel.dk>2024-04-15 08:10:25 -0600
commitd6f911a6b22f8e48aec82cd5f6b5a14dc76a56c3 (patch)
treefefd69b3b1a37166e74543f4d12f786ad7f26913 /io_uring/rw.h
parentcca6571381a0bdc88021a1f7a4c2349df21279f7 (diff)
io_uring/rw: add iovec recycling
Let the io_async_rw hold on to the iovec and reuse it, rather than always allocate and free them. Also enables KASAN for the iovec entries, so that reuse can be detected even while they are in the cache. While doing so, shrink io_async_rw by getting rid of the bigger embedded fast iovec. Since iovecs are being recycled now, shrink it from 8 to 1. This reduces the io_async_rw size from 264 to 160 bytes, a 40% reduction. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/rw.h')
-rw-r--r--io_uring/rw.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/io_uring/rw.h b/io_uring/rw.h
index 7824896dc52d..cf51d0eb407a 100644
--- a/io_uring/rw.h
+++ b/io_uring/rw.h
@@ -9,8 +9,9 @@ struct io_async_rw {
};
struct iov_iter iter;
struct iov_iter_state iter_state;
- struct iovec fast_iov[UIO_FASTIOV];
+ struct iovec fast_iov;
struct iovec *free_iovec;
+ int free_iov_nr;
struct wait_page_queue wpq;
};