io_uring/rw: always setup io_async_rw for read/write requests
authorJens Axboe <axboe@kernel.dk>
Mon, 18 Mar 2024 22:13:01 +0000 (16:13 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 26 Mar 2024 17:08:32 +0000 (11:08 -0600)
commit1383e5686532452a6a4a646d564e8bd6e84eb2d0
tree543c561916c558e68a7ce4b1604bca70aff631d5
parent07e52780105719eedeab9419623212d137a044b6
io_uring/rw: always setup io_async_rw for read/write requests

read/write requests try to put everything on the stack, and then alloc
and copy if a retry is needed. This necessitates a bunch of nasty code
that deals with intermediate state.

Get rid of this, and have the prep side setup everything that is needed
upfront, which greatly simplifies the opcode handlers.

This includes adding an alloc cache for io_async_rw, to make it cheap
to handle.

In terms of cost, this should be basically free and transparent. For
the worst case of {READ,WRITE}_FIXED which didn't need it before,
performance is unaffected in the normal peak workload that is being
used to test that. Still runs at 122M IOPS.

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