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>
Wed, 19 Jul 2023 19:45:58 +0000 (13:45 -0600)
commit6441147184b92b070cccdbf5dbadc9738456c685
tree8a265136397d40f735fe64848c30c0a9e95a09fe
parent3a943ce468d71bdc77d68b9feb419d3acbb0474b
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