iommu/arm-smmu-v3: Avoid back-to-back CMD_SYNC operations
authorZhen Lei <thunder.leizhen@huawei.com>
Sun, 19 Aug 2018 07:51:11 +0000 (15:51 +0800)
committerWill Deacon <will.deacon@arm.com>
Mon, 1 Oct 2018 12:01:30 +0000 (13:01 +0100)
commit901510ee32f7190902f6fe4affb463e5d86a804c
tree8dd5e201f928a66719efcf13327e6d5a746b1d5e
parent0f02477d16980938a84aba8688a4e3a303306116
iommu/arm-smmu-v3: Avoid back-to-back CMD_SYNC operations

Putting adjacent CMD_SYNCs into the command queue is nonsensical, but
can happen when multiple CPUs are inserting commands. Rather than leave
the poor old hardware to chew through these operations, we can instead
drop the subsequent SYNCs and poll for completion of the first. This
has been shown to improve IO performance under pressure, where the
number of SYNC operations reduces by about a third:

CMD_SYNCs reduced: 19542181
CMD_SYNCs total: 58098548 (include reduced)
CMDs total: 116197099 (TLBI:SYNC about 1:1)

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
drivers/iommu/arm-smmu-v3.c