HomeFreeBSD

iommu_gas: use to first-fit search for lowermatch

Description

iommu_gas: use to first-fit search for lowermatch

Reverse the order of the search for a free space in lowermatch, to
make it a first-fit search. Iommu_gas_match_one always allocates from
the beginning of the free gap discovered from searching the tree, so
the current code isn't really allocating in a reverse first-fit
anyway, and making the search first-fit reduces the number of iommu
page table pages that are used.

Reported by: alc
Reviewed by: alc, kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35458

(cherry picked from commit 975715b78819c6de68df15a6dd78157c6dba0fcb)

Details

Provenance
dougmAuthored on Jun 14 2022, 5:47 AM
Reviewer
alc
Differential Revision
D35458: iommu_gas: change to first-fit search for lowermatch
Parents
rG2d8b9313f47e: iommu_gas: pass size to iommu_map without rounding
Branches
Unknown
Tags
Unknown