diff options
| author | Ranjan Kumar <ranjan.kumar@broadcom.com> | 2026-09-16 13:57:00 +0530 |
|---|---|---|
| committer | Martin K. Petersen (Oracle) <mkp@kernel.org> | 2026-09-16 22:14:22 -0400 |
| commit | 7342b9f0e3065c086605f075a204972d270b267b (patch) | |
| tree | 145920661f3efdb4bad2c75279f128ba54bf6a09 /tools/perf/scripts/python | |
| parent | fb8b6139770a5dee8ace9e605b5c3d11861506c8 (diff) | |
| download | linux-next-7342b9f0e3065c086605f075a204972d270b267b.tar.gz linux-next-7342b9f0e3065c086605f075a204972d270b267b.zip | |
scsi: mpi3mr: Fix performance regression caused by extended IRQ poll sleep
Commit 24d7071d9645 ("scsi: mpi3mr: A performance fix") increased the
threaded IRQ poll sleep range from 2-20 us to 20-21 us to work around a
timer slack issue.
On kernels unaffected by the timer slack issue, the longer sleep interval
reduces reply queue processing efficiency and causes an approximately 7%
throughput regression on NVMe direct-attached RAID10 configurations.
Restore the IRQ poll sleep base to 2 us (widening the usleep_range() upper
bound to 10x the base instead of a fixed +1 us) to recover the lost
throughput, and skip the sleep entirely once pend_ios reaches 0 so the poll
loop exits immediately at the tail of a completion burst.
Additionally, resolve the following issues in the reply queue processing
and polling logic:
1. Add missing dma_rmb() memory barriers in the admin and operational
reply queue processing loops. This ensures that the descriptor payload
is only read after the phase bit check is complete, preventing weakly
ordered architectures from speculatively processing stale data.
2. Add bounds checking for `request_queue_id` in
mpi3mr_process_op_reply_q(). An out-of-range id is now logged and the
descriptor is retired (consumer index advanced, phase toggled on
wraparound) rather than aborting the loop in place, which previously
left the same corrupted descriptor at the head of the ring forever and
stalled polling indefinitely. It is not counted toward pend_ios, since
no real completion was processed for it.
3. Recheck for a late-arriving descriptor via dma_rmb() while still
holding op_reply_q->in_use, instead of releasing it and reclaiming it
afterward, which could race and reprocess a descriptor with stale
indices or double-decrement in_use.
4. Replace a direct panic() call with a safe ioc_err() log and abort in
mpi3mr_process_op_reply_desc() when mpi3mr_get_reply_virt_addr()
returns NULL. This prevents a single malformed DMA reply address from
crashing the entire host OS. The reply_dma output parameter is also
cleared before returning, since it was already populated with the
unvalidated address before the NULL check. Leaving it set would make
the caller repost that unvalidated address back to the hardware.
Note: The unbounded busy-wait loop (usleep_range) in mpi3mr_isr_poll()
flagged by automated review is intentionally retained. This short sleep
polling mechanism is critical for batching completions and achieving the
target throughput on high-performance NVMe configurations.
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://sashiko.dev/#/patchset/20260626114109.43685-1-ranjan.kumar@broadcom.com?part=5
Closes: https://sashiko.dev/#/patchset/20260708183305.244485-1-ranjan.kumar@broadcom.com?part=5
Closes: https://sashiko.dev/#/patchset/20260724102505.115136-1-ranjan.kumar@broadcom.com?part=5
Closes: https://sashiko.dev/#/patchset/20260805110634.346670-1-ranjan.kumar@broadcom.com?part=5
Co-developed-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Chandrakanth Patil <chandrakanth.patil@broadcom.com>
Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Link: https://patch.msgid.link/20260916082705.44712-6-ranjan.kumar@broadcom.com
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
