Re: [PATCH 1/1] Revert "iommu/iova: Retry from last rb tree node if iova search fails"

From: John Garry
Date: Wed Mar 10 2021 - 12:53:25 EST


On 08/03/2021 16:22, John Garry wrote:


While max32_alloc_size indirectly tracks the largest*contiguous* available space, one of the ideas from which it grew was to simply keep
count of the total number of free PFNs. If you're really spending
significant time determining that the tree is full, as opposed to just
taking longer to eventually succeed, then it might be relatively
innocuous to tack on that semi-redundant extra accounting as a
self-contained quick fix for that worst case.


...

So since the retry means that we search through the complete pfn range most of the time (due to poor success rate quoted), we should be able to do a better job at maintaining an accurate max alloc size, by calculating it during the failed search, and not relying on max alloc failed or resetting it frequently. Hopefully that would mean that we're smarter about quickly failing the allocation.

I'll further look at that.

Thanks,
John