Skip to content
  • Robin Murphy's avatar
    iommu/iova: Try harder to allocate from rcache magazine · e8b19840
    Robin Murphy authored
    
    
    When devices with different DMA masks are using the same domain, or for
    PCI devices where we usually try a speculative 32-bit allocation first,
    there is a fair possibility that the top PFN of the rcache stack at any
    given time may be unsuitable for the lower limit, prompting a fallback
    to allocating anew from the rbtree. Consequently, we may end up
    artifically increasing pressure on the 32-bit IOVA space as unused IOVAs
    accumulate lower down in the rcache stacks, while callers with 32-bit
    masks also impose unnecessary rbtree overhead.
    
    In such cases, let's try a bit harder to satisfy the allocation locally
    first - scanning the whole stack should still be relatively inexpensive.
    
    Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
    Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
    e8b19840