iommu/iova: Free global iova rcache on iova alloc failure
authorVijayanand Jitta <vjitta@codeaurora.org>
Wed, 30 Sep 2020 07:44:24 +0000 (13:14 +0530)
committerWill Deacon <will@kernel.org>
Tue, 17 Nov 2020 23:03:13 +0000 (23:03 +0000)
commit6fa3525b455ae1fde5b424907141b33651f137b0
tree5235b024ac5d9a33890585d5ea496b3485dde738
parent4e89dce725213d3d0b0475211b500eda4ef4bf2f
iommu/iova: Free global iova rcache on iova alloc failure

When ever an iova alloc request fails we free the iova
ranges present in the percpu iova rcaches and then retry
but the global iova rcache is not freed as a result we could
still see iova alloc failure even after retry as global
rcache is holding the iova's which can cause fragmentation.
So, free the global iova rcache as well and then go for the
retry.

Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Acked-by: John Garry <john.garry@huaqwei.com>
Link: https://lore.kernel.org/r/1601451864-5956-2-git-send-email-vjitta@codeaurora.org
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/iova.c