iommu/arm-smmu-v3: Improve cmdq lock efficiency
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest posting 2/22 patches 5 repliesIn review
- v2 RFC posting 1/24 patches 0 repliesSuperseded
- v1 RFC2 patches 0 repliesSuperseded
Patches in v2 posting 2/2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | iommu/arm-smmu-v3: Calculate max commands per batchdrivers/ | +42 | 0 replies | |
| 2/2 | iommu/arm-smmu-v3: Remove cmpxchg() in arm_smmu_cmdq_issue_cmdlist()drivers/ | +72 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/2] iommu/arm-smmu-v3: Improve cmdq lock efficiency
As mentioned in [0], the CPU may consume many cycles processing arm_smmu_cmdq_issue_cmdlist(). One issue we find is the cmpxchg() loop to get space on the queue takes a lot of time once we start getting many CPUs contending - from experiment, for 64 CPUs contending the cmdq, success rate is ~ 1 in 12, which is poor, but not totally awful.
This series removes that cmpxchg() and replaces with an atomic_add, same as how the actual cmdq deals with maintaining the prod pointer.
For my NVMe test with 3x NVMe SSDs, I'm getting a ~24% throughput increase:
Before: 1250K IOPs
After: 1550K IOPs
I also have a test harness to check the rate of DMA map+unmaps we can achieve:
CPU count 8 16 32 64
Before: 282K 115K 36K 11K
After: 302K 193K 80K 30K
(unit is map+unmaps per CPU per second)
Differences to v1:
- Simplify by dropping patch to always issue a CMD_SYNC
- Use 64b atomic add, keeping prod in a separate 32b field
John Garry (2):
iommu/arm-smmu-v3: Calculate max commands per batch iommu/arm-smmu-v3: Remove cmpxchg() in arm_smmu_cmdq_issue_cmdlist()
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 166 ++++++++++++++------ 1 file changed, 114 insertions(+), 52 deletions(-)
Signature · 6 lines
2.26.2 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu