Maintain a pointer to an element in the iommu_gas_entries tree that is left of the first free gap in the tree and start the search for free space there, rather than at the root of the tree. The element is the rightmost such element, except possibly after an insertion that exactly fills up the first free gap. In that case, the next insertion finds the first free gap and updates the pointer.