]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: target: Add support for completing commands from backend context
authorMike Christie <michael.christie@oracle.com>
Sun, 22 Feb 2026 23:27:01 +0000 (17:27 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 1 Mar 2026 02:04:02 +0000 (21:04 -0500)
commit06933066d88a3093953b062922c016a67d2cdbf8
tree80ce30f27d28bc00f04836e60f847113f4ec8847
parent6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
scsi: target: Add support for completing commands from backend context

To complete a command several drivers just drop their reference and add
it to list to be processed by a driver specific thread. So there's no
need to go from backend context to the LIO thread then to the driver's
thread. When avoiding the LIO thread, IOPS can increase from 20-30% for
workloads like:

  fio --filename=/dev/sdb  --direct=1 --rw=randrw --bs=8K \
    --ioengine=libaio --iodepth=128  --numjobs=$jobs

where increasing jobs increases the performance improvement (this is
using NVMe drives with LIO's submit_type=1 to directly submit).

Add the infrastructure so drivers and userspace can control how to
complete a command like is done for the submission path. In this commit
there is no behavior change and we continue to defer to the LIO
workqueue thread. In the subsequent commits we will allow drivers to
report what they support and allow userspace to control the behavior.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://patch.msgid.link/20260222232946.7637-2-michael.christie@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_device.c
drivers/target/target_core_transport.c
include/target/target_core_base.h
include/target/target_core_fabric.h