]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
loop: add hint for handling aio via IOCB_NOWAIT
authorMing Lei <ming.lei@redhat.com>
Wed, 15 Oct 2025 11:07:31 +0000 (19:07 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 18 Nov 2025 13:49:52 +0000 (06:49 -0700)
commit837ed303964673cf0c7e6a4624cd68d8cf254827
tree3aeb606dd1f08dda35eec6a1652d51504efb40d7
parent0ba93a906dda7ede9e7669adefe005ee18f3ff42
loop: add hint for handling aio via IOCB_NOWAIT

Add hint for using IOCB_NOWAIT to handle loop aio command for avoiding
to cause write(especially randwrite) perf regression on sparse backed file.

Try IOCB_NOWAIT in the following situations:

- backing file is block device

OR

- READ aio command

OR

- there isn't any queued blocking async WRITEs, because NOWAIT won't cause
contention with blocking WRITE, which often implies exclusive lock

With this simple policy, perf regression of randwrite/write on sparse
backing file is fixed.

Link: https://lore.kernel.org/dm-devel/7d6ae2c9-df8e-50d0-7ad6-b787cb3cfab4@redhat.com/
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/loop.c