In iommu_gas_lowermatch and iommu_gas_uppermatch, a subtree search is quickly terminated if the largest available free space in the subtree is below a limit, where that limit is related to the size of the allocation request. However, that limit is too small; it does not account for both of the guard pages that will surround the allocated space, but only for one of them. Consequently, it permits the search to proceed through nodes that cannot produce a successful allocation for all the requested space. Fix that limit to improve search performance.
Submitted by: Weixi Zhu (wxzhu@rice.edu)