]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
scsi: target: Move LUN stats to per-CPU
authorMike Christie <michael.christie@oracle.com>
Wed, 17 Sep 2025 22:12:55 +0000 (17:12 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 3 Nov 2025 03:06:12 +0000 (22:06 -0500)
commitbbb490053173b737604a87af03f2113fb1c279a0
treed9432a07971601b78189efc93d807d49e5cf65d2
parented6b97a79577db9bf9d7b21fd623f24f499e3acc
scsi: target: Move LUN stats to per-CPU

The atomic use in the main I/O path is causing perf issues when using
higher performance backend devices and multiple queues (more than
10 when using vhost-scsi) like with this fio workload:

[global]
bs=4K
iodepth=128
direct=1
ioengine=libaio
group_reporting
time_based
runtime=120
name=standard-iops
rw=randread
numjobs=16
cpus_allowed=0-15

To fix this issue, move the LUN stats to per CPU.

Note: I forgot to include this patch with the delayed/ordered per CPU
tracking and per device/device entry per CPU stats. With this patch you
get the full 33% improvements when using fast backends, multiple queues
and multiple IO submiters.

Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Link: https://patch.msgid.link/20250917221338.14813-4-michael.christie@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_device.c
drivers/target/target_core_fabric_configfs.c
drivers/target/target_core_internal.h
drivers/target/target_core_stat.c
drivers/target/target_core_tpg.c
drivers/target/target_core_transport.c
include/target/target_core_base.h