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>
Tue, 26 Mar 2024 17:08:46 +0000 (11:08 -0600)
commit51579c7281afd37dbb7e7548a858bdd097c712b4
tree324a5b3cd99c2c66bccfcb6639d3d579171279e8
parentc562b60255a3557c6559548cce8acaf5f93066f7
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