Skip to content

Commit eff1947

Browse files
Zhen Leiwilldeacon
authored andcommitted
iommu/arm-smmu-v3: Use command queue batching helpers to improve performance
The obvious key to the performance optimization of commit 587e6c1 ("iommu/arm-smmu-v3: Reduce contention during command-queue insertion") is to allow multiple cores to insert commands in parallel after a brief mutex contention. Obviously, inserting as many commands at a time as possible can reduce the number of times the mutex contention participates, thereby improving the overall performance. At least it reduces the number of calls to function arm_smmu_cmdq_issue_cmdlist(). Therefore, use command queue batching helpers to insert multiple commands at a time. Signed-off-by: Zhen Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent ef75702 commit eff1947

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1747,15 +1747,16 @@ static int arm_smmu_atc_inv_master(struct arm_smmu_master *master)
17471747
{
17481748
int i;
17491749
struct arm_smmu_cmdq_ent cmd;
1750+
struct arm_smmu_cmdq_batch cmds = {};
17501751

17511752
arm_smmu_atc_inv_to_cmd(0, 0, 0, &cmd);
17521753

17531754
for (i = 0; i < master->num_streams; i++) {
17541755
cmd.atc.sid = master->streams[i].id;
1755-
arm_smmu_cmdq_issue_cmd(master->smmu, &cmd);
1756+
arm_smmu_cmdq_batch_add(master->smmu, &cmds, &cmd);
17561757
}
17571758

1758-
return arm_smmu_cmdq_issue_sync(master->smmu);
1759+
return arm_smmu_cmdq_batch_submit(master->smmu, &cmds);
17591760
}
17601761

17611762
int arm_smmu_atc_inv_domain(struct arm_smmu_domain *smmu_domain, int ssid,

0 commit comments

Comments
 (0)