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>
Mon, 15 Apr 2024 14:10:25 +0000 (08:10 -0600)
commita9165b83c1937eeed1f0c731468216d6371d647f
treeb7444f11aca3a27908c5b1660344efe44cbc190e
parentd80f940701302e84d1398ecb103083468b566a69
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