iommu/iova: Extend rbtree node caching
authorRobin Murphy <robin.murphy@arm.com>
Thu, 21 Sep 2017 15:52:44 +0000 (16:52 +0100)
committerJoerg Roedel <jroedel@suse.de>
Wed, 27 Sep 2017 15:09:57 +0000 (17:09 +0200)
commite60aa7b53845a261dd419652f12ab9f89e668843
tree4fd8f76916b5ad7b393f6e9c1382cd36443ab4e5
parent086c83acb70fc6da044c9ca45c1c9780c64545b0
iommu/iova: Extend rbtree node caching

The cached node mechanism provides a significant performance benefit for
allocations using a 32-bit DMA mask, but in the case of non-PCI devices
or where the 32-bit space is full, the loss of this benefit can be
significant - on large systems there can be many thousands of entries in
the tree, such that walking all the way down to find free space every
time becomes increasingly awful.

Maintain a similar cached node for the whole IOVA space as a superset of
the 32-bit space so that performance can remain much more consistent.

Inspired by work by Zhen Lei <thunder.leizhen@huawei.com>.

Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Zhen Lei <thunder.leizhen@huawei.com>
Tested-by: Nate Watterson <nwatters@codeaurora.org>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iova.c
include/linux/iova.h