FROMLIST: iommu/iova: Add a best-fit algorithm

Using the best-fit algorithm, instead of the first-fit
algorithm, may reduce fragmentation when allocating
IOVAs.

Bug: 149544392
Link: https://lore.kernel.org/lkml/7239ddd532e94a4371289f3be23c66a3@codeaurora.org/
Change-Id: Icfbac0cc7be972a092915335508cbc73c47471cf
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
This commit is contained in:
Patrick Daly
2020-02-26 14:16:19 -08:00
committed by Chris Goldsworthy
parent 0d5de782bb
commit c640e76a4e
4 changed files with 98 additions and 2 deletions

View File

@@ -95,6 +95,7 @@ struct iova_domain {
flush-queues */
atomic_t fq_timer_on; /* 1 when timer is active, 0
when not */
bool best_fit;
};
static inline unsigned long iova_size(struct iova *iova)