aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorJohn Garry <[email protected]>2023-03-13 09:31:14 +0000
committerMartin K. Petersen <[email protected]>2023-03-17 03:25:37 +0000
commit548ebb335f743fa2647fe61bb1ad29d2c706afda (patch)
tree130bc354337127f6c877d5166417b4d3b13f5ee7 /drivers/scsi/scsi_debug.c
parentscsi: scsi_debug: Get command abort feature working again (diff)
downloadkernel-548ebb335f743fa2647fe61bb1ad29d2c706afda.tar.gz
kernel-548ebb335f743fa2647fe61bb1ad29d2c706afda.zip
scsi: scsi_debug: Add poll mode deferred completions to statistics
Currently commands completed via poll mode are not included in the statistics gathering for deferred completions and missed CPUs. Poll mode completions should be treated the same as other deferred completion types, so add poll mode completions to the statistics. Signed-off-by: John Garry <[email protected]> Acked-by: Douglas Gilbert <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 2b25c2090ac9..7ed117e78bd4 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -7531,6 +7531,13 @@ static int sdebug_blk_mq_poll(struct Scsi_Host *shost, unsigned int queue_num)
}
WRITE_ONCE(sd_dp->defer_t, SDEB_DEFER_NONE);
spin_unlock_irqrestore(&sqp->qc_lock, iflags);
+
+ if (sdebug_statistics) {
+ atomic_inc(&sdebug_completions);
+ if (raw_smp_processor_id() != sd_dp->issuing_cpu)
+ atomic_inc(&sdebug_miss_cpus);
+ }
+
scsi_done(scp); /* callback to mid level */
num_entries++;
spin_lock_irqsave(&sqp->qc_lock, iflags);