io_uring/msg_ring: add an alloc cache for io_kiocb entries
authorJens Axboe <axboe@kernel.dk>
Thu, 6 Jun 2024 18:25:01 +0000 (12:25 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 24 Jun 2024 14:39:55 +0000 (08:39 -0600)
commit50cf5f3842af3135b88b041890e7e12a74425fcb
tree7c7f4035cbb6be7a747f264693345235fc64ee52
parent0617bb500bfabf8447062f1e1edde92ed2b638f1
io_uring/msg_ring: add an alloc cache for io_kiocb entries

With slab accounting, allocating and freeing memory has considerable
overhead. Add a basic alloc cache for the io_kiocb allocations that
msg_ring needs to do. Unlike other caches, this one is used by the
sender, grabbing it from the remote ring. When the remote ring gets
the posted completion, it'll free it locally. Hence it is separately
locked, using ctx->msg_lock.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/io_uring.c
io_uring/msg_ring.c
io_uring/msg_ring.h