Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 292a8942 authored by Vinayak Menon's avatar Vinayak Menon Committed by Gerrit - the friendly Code Review server
Browse files

iommu: do not attempt reclaim on higher order allocs



Attempting reclaim for non-zero order allocations can result in
the context blocked in reclaim for unpredictable amounts of time.
There are cases reported where dma_alloc_attrs gets blocked for
20+ seconds for an allocation of 200MB. Since higher order
allocation is not a necessity in the presence of iommu, avoid
reclaim.

Change-Id: I93f57e2ea5f7c57ec84a92911e2aae36112d95e1
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 71ba584c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -475,8 +475,9 @@ static struct page **__iommu_dma_alloc_pages(unsigned int count,
			unsigned int order = __fls(order_mask);

			order_size = 1U << order;
			page = alloc_pages((order_mask - order_size) ?
					   gfp | __GFP_NORETRY : gfp, order);
			page = alloc_pages(order ?
					   (gfp | __GFP_NORETRY) &
						~__GFP_RECLAIM : gfp, order);
			if (!page)
				continue;
			if (!order)