io_uring/rw: add write support for IOCB_DIO_DEFER
authorJens Axboe <axboe@kernel.dk>
Sat, 8 Jul 2023 16:03:52 +0000 (10:03 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 11 Jul 2023 19:52:08 +0000 (13:52 -0600)
commitb9f9fbed0747d81b7f2f04d16123e8d2c086e296
treedc0cd3cbfef114e33a6e69e65b944fb30ce090c4
parentf9f8b03900fcd09aa9906ce72627ba23d818ff8d
io_uring/rw: add write support for IOCB_DIO_DEFER

If the filesystem dio handler understands IOCB_DIO_DEFER, we'll get
a kiocb->ki_complete() callback with kiocb->dio_complete set. In that
case, rather than complete the IO directly through task_work, queue
up an intermediate task_work handler that first processes this
callback and then immediately completes the request.

For XFS, this avoids a punt through a workqueue, which is a lot less
efficient and adds latency to lower queue depth (or sync) O_DIRECT
writes.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rw.c