io_uring/rw: add iovec recycling
authorJens Axboe <axboe@kernel.dk>
Mon, 18 Mar 2024 22:31:44 +0000 (16:31 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Apr 2024 14:10:25 +0000 (08:10 -0600)
commitd6f911a6b22f8e48aec82cd5f6b5a14dc76a56c3
treefefd69b3b1a37166e74543f4d12f786ad7f26913
parentcca6571381a0bdc88021a1f7a4c2349df21279f7
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>
io_uring/rw.c
io_uring/rw.h