summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorXiang Chen <chenxiang66@hisilicon.com>2021-03-25 11:38:24 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-14 10:50:04 +0200
commit2d1f8e635a6b79ad65b50ae7594307d4d56f52af (patch)
treedd5a82c385b244c6e206ae50089af465b4d2863f /include
parent2c72bb31146a00527133809d0dbc1ee883f032f1 (diff)
iommu: Fix a boundary issue to avoid performance drop
[ Upstream commit 3431c3f660a39f6ced954548a59dba6541ce3eb1 ] After the change of patch ("iommu: Switch gather->end to the inclusive end"), the performace drops from 1600+K IOPS to 1200K in our kunpeng ARM64 platform. We find that the range [start1, end1) actually is joint from the range [end1, end2), but it is considered as disjoint after the change, so it needs more times of TLB sync, and spends more time on it. So fix the boundary issue to avoid performance drop. Fixes: 862c3715de8f ("iommu: Switch gather->end to the inclusive end") Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com> Acked-by: Will Deacon <will@kernel.org> Link: https://lore.kernel.org/r/1616643504-120688-1-git-send-email-chenxiang66@hisilicon.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iommu.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index d63d3e9cc7b6..3e82f0dce3cc 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -546,7 +546,7 @@ static inline void iommu_iotlb_gather_add_page(struct iommu_domain *domain,
* structure can be rewritten.
*/
if (gather->pgsize != size ||
- end < gather->start || start > gather->end) {
+ end + 1 < gather->start || start > gather->end + 1) {
if (gather->pgsize)
iommu_iotlb_sync(domain, gather);
gather->pgsize = size;