]> git.baikalelectronics.ru Git - kernel.git/commit
ublk_drv: don't forward io commands in reserve order
authorMing Lei <ming.lei@redhat.com>
Mon, 21 Nov 2022 15:56:45 +0000 (23:56 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 24 Nov 2022 03:36:57 +0000 (20:36 -0700)
commit2e4afcf2a0fb92e0d18de1da48f1c494d17ad3c9
treece04169d8886907abd6a1091f481ccda80622590
parentfa6ef223c3a027886b7d792d34090bfa12d1de2d
ublk_drv: don't forward io commands in reserve order

Either ublk_can_use_task_work() is true or not, io commands are
forwarded to ublk server in reverse order, since llist_add() is
always to add one element to the head of the list.

Even though block layer doesn't guarantee request dispatch order,
requests should be sent to hardware in the sequence order generated
from io scheduler, which usually considers the request's LBA, and
order is often important for HDD.

So forward io commands in the sequence made from io scheduler by
aligning task work with current io_uring command's batch handling,
and it has been observed that both can get similar performance data
if IORING_SETUP_COOP_TASKRUN is set from ublk server.

Reported-by: Andreas Hindborg <andreas.hindborg@wdc.com>
Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: ZiyangZhang <ZiyangZhang@linux.alibaba.com>
Link: https://lore.kernel.org/r/20221121155645.396272-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/ublk_drv.c