Skip to content

nvme-pci: Fix performance regression with completion batching for Hygon processors - #20

Open
ghost wants to merge 1 commit into
for-next_basefrom
series/1199835=>for-next
Open

ghost wants to merge 1 commit into
for-next_basefrom
series/1199835=>for-next

Conversation

@ghost

@ghost ghost commented Nov 10, 2026

Copy link
Copy Markdown

Pull request for series with
subject: nvme-pci: Fix performance regression with completion batching for Hygon processors
version: 1
url: https://patchwork.kernel.org/series/1199835/

@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1199835/
version: 1

@ghost
ghost force-pushed the for-next_base branch from 8c33852 to 18eb5ad Compare November 10, 2026 10:19
…on processors

Commit 4f50224 ("nvme: wire up completion batching for the IRQ path")
introduced completion batching to the NVMe IRQ handling path. While this
change brings performance gains on mainstream platforms, it causes a
severe random read performance regression on Hygon platforms.

The batching logic defers CQE processing until after the doorbell is
written. On Hygon microarchitectures, this specific execution order
accelerates the NVMe controller's interrupt generation. This leads to an
interrupt storm: the overall interrupt count increases significantly,
and each interrupt handles fewer CQEs. Consequently, a massive amount of
CPU cycles are consumed by the fixed overhead of interrupt entry/exit
rather than useful I/O processing, drastically degrading random read
efficiency.

Interrupt statistics were collected on a Hygon platform using a 10-second
workload of 16 jobs with 4 KiB random reads:
With batching: average IOPS ~2.29M; interrupts per queue ~1.82M
Without batching: average IOPS ~2.89M; interrupts per queue ~1.52M

By restoring the single-completion fast path, the interrupt rate is
reduced by ~16%, eliminating the interrupt storm.

Performance results (fio 4k randread, 16 jobs) show
significant improvements across various CPU pinning topologies:

CPU Pinning     | With Batching (kops) | This Patch (kops) | Improvement
0-15,128-143    | 1,747.9              | 2,053.9           | +17.5%
0-11,128-139    | 1,939.8              | 2,437.6           | +25.7%
0-7,128-135     | 2,341.9              | 2,891.3           | +23.5%
0-15            | 1,754.1              | 2,018.6           | +15.1%
0-11            | 2,051.2              | 2,510.5           | +22.4%

It is worth noting that this issue is not necessarily exclusive to Hygon
CPUs. Architectures with higher interrupt latency or lower overall
performance characteristics may also suffer from similar regressions,
where the overhead of the batching fast path outweighs the benefit of
amortizing the doorbell write.

Instead of hardcoding a permanent revert, introduce a flag 'use_comp_batch'
and disable IRQ completion batching if running on a Hygon CPU. This
preserves the performance benefits for platforms that favor batching
while restoring the optimal single-completion fast path for Hygon, and
provides a scalable mechanism to disable it on other affected platforms
in the future.

Fixes: 4f50224 ("nvme: wire up completion batching for the IRQ path")
Signed-off-by: Liao Xuan <liaoxuan@open-hieco.net>
@ghost

ghost commented Nov 10, 2026

Copy link
Copy Markdown
Author

Upstream branch: de52810
series: https://patchwork.kernel.org/series/1199835/
version: 1

@ghost
ghost force-pushed the series/1199835=>for-next branch from 7ecd629 to 32479dc Compare November 10, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants