]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iommu_gas: restrict tree search to promising paths
authorDoug Moore <dougm@FreeBSD.org>
Mon, 6 Jun 2022 21:26:01 +0000 (16:26 -0500)
committerDoug Moore <dougm@FreeBSD.org>
Mon, 6 Jun 2022 21:26:01 +0000 (16:26 -0500)
commitb831865fe3b8f66281b39a9cb567c92dc285a1da
tree7e1031208e47b6a03de55a3f42d53ee67ba46587
parent156745b42d9e6dfa3d9c6dc480db7836683850cf
iommu_gas: restrict tree search to promising paths

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.

Reviewed by: alc, kib
Submitted by: Weixi Zhu (wxzhu@rice.edu)
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35414
sys/dev/iommu/iommu_gas.c