linux-stable/fs/iomap
Jens Axboe 8c052fb300 iomap: support IOCB_DIO_CALLER_COMP
If IOCB_DIO_CALLER_COMP is set, utilize that to set kiocb->dio_complete
handler and data for that callback. Rather than punt the completion to a
workqueue, we pass back the handler and data to the issuer and will get
a callback from a safe task context.

Using the following fio job to randomly dio write 4k blocks at
queue depths of 1..16:

fio --name=dio-write --filename=/data1/file --time_based=1 \
--runtime=10 --bs=4096 --rw=randwrite --norandommap --buffered=0 \
--cpus_allowed=4 --ioengine=io_uring --iodepth=$depth

shows the following results before and after this patch:

	Stock	Patched		Diff
=======================================
QD1	155K	162K		+ 4.5%
QD2	290K	313K		+ 7.9%
QD4	533K	597K		+12.0%
QD8	604K	827K		+36.9%
QD16	615K	845K		+37.4%

which shows nice wins all around. If we factored in per-IOP efficiency,
the wins look even nicer. This becomes apparent as queue depth rises,
as the offloaded workqueue completions runs out of steam.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-08-01 17:32:49 -06:00
..
buffered-io.c New code for 6.5: 2023-07-02 11:14:54 -07:00
direct-io.c iomap: support IOCB_DIO_CALLER_COMP 2023-08-01 17:32:49 -06:00
fiemap.c fs: Move many prototypes to pagemap.h 2022-03-21 12:59:02 -04:00
iter.c iomap: write iomap validity checks 2022-11-29 09:09:17 +11:00
Makefile iomap: build the block based code conditionally 2021-12-04 08:58:54 -08:00
seek.c iomap: switch iomap_seek_data to use iomap_iter 2021-08-16 21:26:33 -07:00
swapfile.c mm/swap: consider max pages in iomap_swapfile_add_extent 2021-08-18 12:47:52 -07:00
trace.c iomap: Add DIO tracepoints 2023-04-21 08:54:47 -07:00
trace.h iomap: Add DIO tracepoints 2023-04-21 08:54:47 -07:00