]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: ensure REQ_F_ISREG is set async offload
authorJens Axboe <axboe@kernel.dk>
Thu, 21 Jul 2022 15:06:47 +0000 (09:06 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jul 2022 00:39:18 +0000 (18:39 -0600)
commita9e232ca2944ab431c75d67be6803d9d41452115
tree5159aab78b234d41965a12ac991f8a020339cb0e
parenta729e18dba806b90a58d814555ad9fb7ed9d2c17
io_uring: ensure REQ_F_ISREG is set async offload

If we're offloading requests directly to io-wq because IOSQE_ASYNC was
set in the sqe, we can miss hashing writes appropriately because we
haven't set REQ_F_ISREG yet. This can cause a performance regression
with buffered writes, as io-wq then no longer correctly serializes writes
to that file.

Ensure that we set the flags in io_prep_async_work(), which will cause
the io-wq work item to be hashed appropriately.

Fixes: 5f2cba57c643 ("io_uring: move read/write file prep state into actual opcode handler")
Link: https://lore.kernel.org/io-uring/20220608080054.GB22428@xsang-OptiPlex-9020/
Reported-by: kernel test robot <oliver.sang@intel.com>
Tested-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/io_uring.h
io_uring/rw.c